Skip to content

Commit

Permalink
Fixes clippy warnings (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon authored Mar 2, 2023
1 parent 9ef9a92 commit b75a5d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
- name: Check code styles
run: cargo fmt --check
- name: Run Clippy
run: cargo clippy
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo test
8 changes: 6 additions & 2 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ impl<I: Read + Seek> File<I> {
self.name.as_ref()
}

pub fn is_empty(&self) -> bool {
self.len() == 0
}

pub fn len(&self) -> u64 {
self.stream.valid_data_length()
}
Expand All @@ -48,8 +52,8 @@ impl<I: Read + Seek> File<I> {
let fat = self.image.fat() as *const Fat;
let mut image = Box::new(self.image.reader());
let reader = match ClustersReader::new(
unsafe { transmute(params) },
unsafe { transmute(fat) },
unsafe { transmute(&*params) },
unsafe { transmute(&*fat) },
unsafe { transmute(image.as_mut().deref_mut()) },
first_cluster,
Some(self.stream.valid_data_length()),
Expand Down

0 comments on commit b75a5d2

Please sign in to comment.