[niepce/lr-import: 19/20] Fix some clippy warnings
- From: Hubert Figuière <hub src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [niepce/lr-import: 19/20] Fix some clippy warnings
- Date: Mon, 20 Dec 2021 05:37:15 +0000 (UTC)
commit d0796087d48e015b71f2095a01e8b3a9a49990f4
Author: Hubert Figuière <hub figuiere net>
Date: Tue Dec 14 23:03:52 2021 -0500
Fix some clippy warnings
crates/npc-engine/src/importer/lrimporter.rs | 6 +++---
crates/npc-fwk/src/capi.rs | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/crates/npc-engine/src/importer/lrimporter.rs b/crates/npc-engine/src/importer/lrimporter.rs
index 7db02e1..38234ae 100644
--- a/crates/npc-engine/src/importer/lrimporter.rs
+++ b/crates/npc-engine/src/importer/lrimporter.rs
@@ -92,10 +92,10 @@ impl LrImporter {
if let Some(images) = images {
dbg_out!("Has images");
images.iter().for_each(|id| {
- self.image_map.get(&id).map(|npc_image_id| {
+ if let Some(npc_image_id) = self.image_map.get(&id) {
dbg_out!("adding {} to album {}", npc_image_id, nid);
libclient.add_to_album(*npc_image_id, nid);
- });
+ }
});
}
}
@@ -103,7 +103,7 @@ impl LrImporter {
fn populate_bundle(file: &LibraryFile, folder_path: &str, bundle: &mut FileBundle) {
let mut xmp_file: Option<String> = None;
let mut jpeg_file: Option<String> = None;
- let sidecar_exts = file.sidecar_extensions.split(",");
+ let sidecar_exts = file.sidecar_extensions.split(',');
sidecar_exts.for_each(|ext| {
if !ext.is_empty() {
return;
diff --git a/crates/npc-fwk/src/capi.rs b/crates/npc-fwk/src/capi.rs
index 207f684..aeda373 100644
--- a/crates/npc-fwk/src/capi.rs
+++ b/crates/npc-fwk/src/capi.rs
@@ -26,5 +26,5 @@ use std::ffi::CString;
/// Dereference the pointer
#[no_mangle]
pub unsafe extern "C" fn rust_cstring_delete(string: *mut c_char) {
- CString::from_raw(string);
+ drop(CString::from_raw(string));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]