Skip to content

Commit

Permalink
Fix more clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcebox committed Jan 2, 2022
1 parent 15a4142 commit 44ae1d4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ impl App {
}

/// Open a DFU file
fn open_file(&mut self, file_path: &std::path::PathBuf) {
fn open_file(&mut self, file_path: &std::path::Path) {
let dfu_file = dfufile::DfuFile::open(file_path);

match dfu_file {
Expand Down
31 changes: 14 additions & 17 deletions src/ui/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,24 +219,21 @@ pub fn content_info(
});
ui.label(format!("{}", image.target_prefix.dwTargetSize));
ui.label(format!("{}", image.target_prefix.dwNbElements));
match device_info {
Some(device_info) => {
let target = device_info.alt_settings.iter().find(|&alt| {
alt.0 == image.target_prefix.bAlternateSetting
});
if let Some(target) = target {
ui.add(egui::Label::new(
egui::RichText::new(&target.1)
.color(egui::Color32::GREEN),
));
} else {
ui.add(egui::Label::new(
egui::RichText::new("Not found")
.color(egui::Color32::RED),
));
}
if let Some(device_info) = device_info {
let target = device_info.alt_settings.iter().find(|&alt| {
alt.0 == image.target_prefix.bAlternateSetting
});
if let Some(target) = target {
ui.add(egui::Label::new(
egui::RichText::new(&target.1)
.color(egui::Color32::GREEN),
));
} else {
ui.add(egui::Label::new(
egui::RichText::new("Not found")
.color(egui::Color32::RED),
));
}
None => {}
}
ui.end_row();
}
Expand Down

0 comments on commit 44ae1d4

Please sign in to comment.