cargo clippy fixes

This commit is contained in:
Tomáš Mládek 2021-12-04 16:46:13 +01:00
parent 6edf550a95
commit 4403f518c9
2 changed files with 3 additions and 4 deletions

View file

@ -202,9 +202,9 @@ pub fn fetch_or_create_dir<C: Connection<Backend = Sqlite>>(
}; };
insert_entry(connection, directory_entry)?; insert_entry(connection, directory_entry)?;
if parent.is_some() { if let Some(parent) = parent {
let has_entry = Entry { let has_entry = Entry {
entity: parent.unwrap(), entity: parent,
attribute: String::from(HIER_HAS_ATTR), attribute: String::from(HIER_HAS_ATTR),
value: EntryValue::Address(new_directory_address.clone()), value: EntryValue::Address(new_directory_address.clone()),
}; };

View file

@ -216,8 +216,7 @@ fn _process_directory_entry<P: AsRef<Path>>(
let existing_files_read = existing_files.read().unwrap(); let existing_files_read = existing_files.read().unwrap();
let maybe_existing_file = existing_files_read let maybe_existing_file = existing_files_read
.iter() .iter()
.find(|file| file.path == normalized_path_str) .find(|file| file.path == normalized_path_str);
.clone();
if let Some(existing_file) = maybe_existing_file { if let Some(existing_file) = maybe_existing_file {
let existing_file = existing_file.clone(); let existing_file = existing_file.clone();