FatFs: moved data/inner behind Rc+RefCell

so that non-mut ref can read
This commit is contained in:
Moritz Gmeiner 2025-07-27 00:24:32 +02:00
commit fc7a0c4616
3 changed files with 27 additions and 17 deletions

View file

@ -1,6 +1,5 @@
use std::io::Read;
use crate::fat::Fatty;
use crate::subslice::SubSlice;
use crate::utils::replace;
use crate::{FatFs, SliceLike};
@ -12,7 +11,7 @@ pub struct ClusterChainReader<'a, S: SliceLike> {
}
impl<'a, S: SliceLike> ClusterChainReader<'a, S> {
pub fn new(fat_fs: &'a mut FatFs<S>, first_cluster: u32) -> ClusterChainReader<'a, S> {
pub fn new(fat_fs: &'a FatFs<S>, first_cluster: u32) -> ClusterChainReader<'a, S> {
let next_cluster = fat_fs.next_cluster(first_cluster).unwrap_or(None);
let sub_slice = fat_fs.cluster_as_subslice(first_cluster);