diff --git a/src/dir.rs b/src/dir.rs index 0808585..f167ad8 100644 --- a/src/dir.rs +++ b/src/dir.rs @@ -109,10 +109,9 @@ impl <'a, T: ReadWriteSeek + 'a> Dir<'a, T> { /// Creates directory entries iterator. pub fn iter(&self) -> DirIter<'a, T> { - self.stream.clone(); DirIter { stream: self.stream.clone(), - fs: self.fs.clone(), + fs: self.fs, err: false, } } diff --git a/src/file.rs b/src/file.rs index 7974ff7..e6cff7f 100644 --- a/src/file.rs +++ b/src/file.rs @@ -240,7 +240,7 @@ impl<'a, T: ReadWriteSeek> Write for File<'a, T> { if self.first_cluster.is_none() { self.set_first_cluster(new_cluster); } - if self.entry.clone().map_or(true, |e| e.inner().size().is_none()) { + if self.entry.iter().next().map_or(true, |e| e.inner().size().is_none()) { // zero new directory cluster trace!("zeroing directory cluser {}", new_cluster); let abs_pos = self.fs.offset_from_cluster(new_cluster);