diff --git a/Cargo.lock b/Cargo.lock index 9e2d3a0..b3a5970 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3114,9 +3114,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.68" +version = "0.10.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +checksum = "61cfb4e166a8bb8c9b55c500bc2308550148ece889be90f609377e58140f42c6" dependencies = [ "bitflags 2.8.0", "cfg-if", @@ -3146,9 +3146,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.104" +version = "0.9.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +checksum = "8b22d5b84be05a8d6947c7cb71f7c849aa0f112acd4bf51c2a7c1c988ac0a9dc" dependencies = [ "cc", "libc", diff --git a/deny.toml b/deny.toml index cd4afae..e2bd725 100644 --- a/deny.toml +++ b/deny.toml @@ -239,7 +239,7 @@ allow-git = [] [sources.allow-org] # github.com organizations to allow git sources for -github = [] +github = ["encounter"] # gitlab.com organizations to allow git sources for gitlab = [] # bitbucket.org organizations to allow git sources for diff --git a/objdiff-cli/src/cmd/diff.rs b/objdiff-cli/src/cmd/diff.rs index fd80a66..592723a 100644 --- a/objdiff-cli/src/cmd/diff.rs +++ b/objdiff-cli/src/cmd/diff.rs @@ -315,19 +315,15 @@ impl ObjectConfig { (target_obj_dir, &object.path, &object.target_path) { Some(target_obj_dir.join(path.with_platform_encoding())) - } else if let Some(path) = &object.target_path { - Some(project_dir.join(path.with_platform_encoding())) } else { - None + object.target_path.as_ref().map(|path| project_dir.join(path.with_platform_encoding())) }; let base_path = if let (Some(base_obj_dir), Some(path), None) = (base_obj_dir, &object.path, &object.base_path) { Some(base_obj_dir.join(path.with_platform_encoding())) - } else if let Some(path) = &object.base_path { - Some(project_dir.join(path.with_platform_encoding())) } else { - None + object.base_path.as_ref().map(|path| project_dir.join(path.with_platform_encoding())) }; Self { name: object.name().to_string(), diff --git a/objdiff-core/src/obj/read.rs b/objdiff-core/src/obj/read.rs index 7550108..ed0904c 100644 --- a/objdiff-core/src/obj/read.rs +++ b/objdiff-core/src/obj/read.rs @@ -386,7 +386,7 @@ fn line_info(obj_file: &File<'_>, sections: &mut [ObjSection], obj_data: &[u8]) .index() .0; - let mut section_data = &reader[..]; + let mut section_data = reader; let size = read_u32(obj_file, &mut section_data)? as usize; if size > reader.len() { bail!("Line info size {size} exceeds remaining size {}", reader.len()); diff --git a/objdiff-core/src/obj/split_meta.rs b/objdiff-core/src/obj/split_meta.rs index ac2010d..b50a46b 100644 --- a/objdiff-core/src/obj/split_meta.rs +++ b/objdiff-core/src/obj/split_meta.rs @@ -39,13 +39,13 @@ impl SplitMeta { } match note.n_type { NT_SPLIT_GENERATOR => { - let string = String::from_utf8(note.desc.to_vec()) - .map_err(|e| anyhow::Error::from(e))?; + let string = + String::from_utf8(note.desc.to_vec()).map_err(anyhow::Error::new)?; result.generator = Some(string); } NT_SPLIT_MODULE_NAME => { - let string = String::from_utf8(note.desc.to_vec()) - .map_err(|e| anyhow::Error::from(e))?; + let string = + String::from_utf8(note.desc.to_vec()).map_err(anyhow::Error::new)?; result.module_name = Some(string); } NT_SPLIT_MODULE_ID => { diff --git a/objdiff-gui/src/app.rs b/objdiff-gui/src/app.rs index 06a0d30..a38bf9e 100644 --- a/objdiff-gui/src/app.rs +++ b/objdiff-gui/src/app.rs @@ -119,19 +119,15 @@ impl ObjectConfig { (target_obj_dir, &object.path, &object.target_path) { Some(target_obj_dir.join(path.with_platform_encoding())) - } else if let Some(path) = &object.target_path { - Some(project_dir.join(path.with_platform_encoding())) } else { - None + object.target_path.as_ref().map(|path| project_dir.join(path.with_platform_encoding())) }; let base_path = if let (Some(base_obj_dir), Some(path), None) = (base_obj_dir, &object.path, &object.base_path) { Some(base_obj_dir.join(path.with_platform_encoding())) - } else if let Some(path) = &object.base_path { - Some(project_dir.join(path.with_platform_encoding())) } else { - None + object.base_path.as_ref().map(|path| project_dir.join(path.with_platform_encoding())) }; let source_path = object.source_path().map(|s| project_dir.join(s.with_platform_encoding())); diff --git a/objdiff-gui/src/views/config.rs b/objdiff-gui/src/views/config.rs index aa0761d..beab5df 100644 --- a/objdiff-gui/src/views/config.rs +++ b/objdiff-gui/src/views/config.rs @@ -384,7 +384,7 @@ fn object_context_ui(ui: &mut egui::Ui, object: &ObjectConfig) { .clicked() { log::info!("Opening file {}", source_path); - if let Err(e) = open::that_detached(&source_path) { + if let Err(e) = open::that_detached(source_path) { log::error!("Failed to open source file: {e}"); } ui.close_menu(); diff --git a/objdiff-gui/src/views/diff.rs b/objdiff-gui/src/views/diff.rs index 12c9617..886a617 100644 --- a/objdiff-gui/src/views/diff.rs +++ b/objdiff-gui/src/views/diff.rs @@ -150,7 +150,7 @@ pub fn diff_view_ui( navigation.view = View::SymbolDiff; } // Execute navigation if it changed - if navigation != current_navigation && !state.post_build_nav.is_some() { + if navigation != current_navigation && state.post_build_nav.is_none() { ret = Some(DiffViewAction::Navigate(navigation)); } diff --git a/objdiff-gui/src/views/symbol_diff.rs b/objdiff-gui/src/views/symbol_diff.rs index ff6c5ff..062863b 100644 --- a/objdiff-gui/src/views/symbol_diff.rs +++ b/objdiff-gui/src/views/symbol_diff.rs @@ -262,11 +262,8 @@ impl DiffViewState { DiffViewAction::SetSearch(search) => { self.search_regex = if search.is_empty() { None - } else if let Ok(regex) = RegexBuilder::new(&search).case_insensitive(true).build() - { - Some(regex) } else { - None + RegexBuilder::new(&search).case_insensitive(true).build().ok() }; self.search = search; }