mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-08 21:17:59 +00:00
clippy & deny fixes
This commit is contained in:
@@ -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()));
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user