removed generic from FatFs, made inner a dyn now
This commit is contained in:
parent
b3d87687dd
commit
a08a84c3e4
7 changed files with 270 additions and 78 deletions
|
|
@ -1,17 +1,17 @@
|
|||
use std::io::Read;
|
||||
|
||||
use crate::FatFs;
|
||||
use crate::subslice::SubSlice;
|
||||
use crate::utils::replace;
|
||||
use crate::{FatFs, SliceLike};
|
||||
|
||||
pub struct ClusterChainReader<'a, S: SliceLike> {
|
||||
sub_slice: SubSlice<'a, S>,
|
||||
pub struct ClusterChainReader<'a> {
|
||||
sub_slice: SubSlice<'a>,
|
||||
|
||||
next_cluster: Option<u32>,
|
||||
}
|
||||
|
||||
impl<'a, S: SliceLike> ClusterChainReader<'a, S> {
|
||||
pub fn new(fat_fs: &'a FatFs<S>, first_cluster: u32) -> ClusterChainReader<'a, S> {
|
||||
impl<'a> ClusterChainReader<'a> {
|
||||
pub fn new(fat_fs: &'a FatFs, first_cluster: u32) -> ClusterChainReader<'a> {
|
||||
let next_cluster = fat_fs.next_cluster(first_cluster).unwrap_or(None);
|
||||
|
||||
let sub_slice = fat_fs.cluster_as_subslice(first_cluster);
|
||||
|
|
@ -39,7 +39,7 @@ impl<'a, S: SliceLike> ClusterChainReader<'a, S> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, S: SliceLike> Read for ClusterChainReader<'a, S> {
|
||||
impl<'a> Read for ClusterChainReader<'a> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
|
||||
if self.sub_slice.is_empty() {
|
||||
if !self.next_cluster() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue