Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseditson committed Jun 17, 2024
1 parent 0682259 commit 85b0f86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions src/binary/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@ impl ArchivalConfig {

pub fn get() -> Self {
match Self::from_fs() {
Ok(config) => {
if let Some(config) = config {
config
} else {
ArchivalConfig::default()
}
}
Ok(config) => config.unwrap_or_default(),
Err(e) => {
eprintln!("config parse failed, using default value. ({})", e);
ArchivalConfig::default()
Expand Down
4 changes: 2 additions & 2 deletions src/object/object_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ impl<'a> Iterator for ObjectEntryMutIterator<'a> {
ObjectEntry::List(l) => {
let o = l.get_mut(self.index);
self.index += 1;
unsafe { std::mem::transmute(o) }
unsafe { std::mem::transmute::<Option<&mut Object>, Option<&mut Object>>(o) }
}
ObjectEntry::Object(o) => {
if self.index == 0 {
self.index = usize::MAX;
unsafe { std::mem::transmute(o) }
unsafe { std::mem::transmute::<&mut Object, Option<&mut Object>>(o) }
} else {
None
}
Expand Down

0 comments on commit 85b0f86

Please sign in to comment.