Skip to content

Commit 12418eb

Browse files
committed
Fix clippy warnings
1 parent e5dfd35 commit 12418eb

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

src/dir.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ impl<'a, IO: ReadWriteSeek, TP, OCC> Dir<'a, IO, TP, OCC> {
117117

118118
/// Creates directory entries iterator.
119119
#[must_use]
120+
#[allow(clippy::iter_not_returning_iterator)]
120121
pub fn iter(&self) -> DirIter<'a, IO, TP, OCC> {
121122
DirIter::new(self.stream.clone(), self.fs, true)
122123
}

src/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl<'a, IO: ReadWriteSeek, TP, OCC> File<'a, IO, TP, OCC> {
110110
bytes_left -= size;
111111
Ok(Extent {
112112
offset: fs.offset_from_cluster(cluster),
113-
size: size,
113+
size,
114114
})
115115
},
116116
Err(e) => Err(e),

src/fs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ impl FsOptions<DefaultTimeProvider, LossyOemCpConverter> {
256256

257257
impl<TP: TimeProvider, OCC: OemCpConverter> FsOptions<TP, OCC> {
258258
/// If enabled accessed date field in directory entry is updated when reading or writing a file.
259+
#[must_use]
259260
pub fn update_accessed_date(mut self, enabled: bool) -> Self {
260261
self.update_accessed_date = enabled;
261262
self

src/table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ impl FatTrait for Fat32 {
519519
{
520520
let old_reserved_bits = Self::get_raw(fat, cluster)? & 0xF000_0000;
521521

522-
if value == FatValue::Free && cluster >= 0x0FFF_FFF7 && cluster <= 0x0FFF_FFFF {
522+
if value == FatValue::Free && (0x0FFF_FFF7..=0x0FFF_FFFF).contains(&cluster) {
523523
// NOTE: it is technically allowed for them to store FAT chain loops,
524524
// or even have them all store value '4' as their next cluster.
525525
// Some believe only FatValue::Bad should be allowed for this edge case.

0 commit comments

Comments
 (0)