Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalh committed Oct 14, 2022
1 parent e5dfd35 commit 12418eb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ impl<'a, IO: ReadWriteSeek, TP, OCC> Dir<'a, IO, TP, OCC> {

/// Creates directory entries iterator.
#[must_use]
#[allow(clippy::iter_not_returning_iterator)]
pub fn iter(&self) -> DirIter<'a, IO, TP, OCC> {
DirIter::new(self.stream.clone(), self.fs, true)
}
Expand Down
2 changes: 1 addition & 1 deletion src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl<'a, IO: ReadWriteSeek, TP, OCC> File<'a, IO, TP, OCC> {
bytes_left -= size;
Ok(Extent {
offset: fs.offset_from_cluster(cluster),
size: size,
size,
})
},
Err(e) => Err(e),
Expand Down
1 change: 1 addition & 0 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ impl FsOptions<DefaultTimeProvider, LossyOemCpConverter> {

impl<TP: TimeProvider, OCC: OemCpConverter> FsOptions<TP, OCC> {
/// If enabled accessed date field in directory entry is updated when reading or writing a file.
#[must_use]
pub fn update_accessed_date(mut self, enabled: bool) -> Self {
self.update_accessed_date = enabled;
self
Expand Down
2 changes: 1 addition & 1 deletion src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ impl FatTrait for Fat32 {
{
let old_reserved_bits = Self::get_raw(fat, cluster)? & 0xF000_0000;

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

0 comments on commit 12418eb

Please sign in to comment.