mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Minor clippy fixes (clippy::format_push_string)
This commit is contained in:
@@ -52,7 +52,8 @@ impl eframe::App for MyApp {
|
||||
"???".to_owned()
|
||||
};
|
||||
if let Some(bytes) = &file.bytes {
|
||||
info += &format!(" ({} bytes)", bytes.len());
|
||||
use std::fmt::Write as _;
|
||||
write!(info, " ({} bytes)", bytes.len()).ok();
|
||||
}
|
||||
ui.label(info);
|
||||
}
|
||||
@@ -72,14 +73,15 @@ impl eframe::App for MyApp {
|
||||
/// Preview hovering files:
|
||||
fn preview_files_being_dropped(ctx: &egui::Context) {
|
||||
use egui::*;
|
||||
use std::fmt::Write as _;
|
||||
|
||||
if !ctx.input().raw.hovered_files.is_empty() {
|
||||
let mut text = "Dropping files:\n".to_owned();
|
||||
for file in &ctx.input().raw.hovered_files {
|
||||
if let Some(path) = &file.path {
|
||||
text += &format!("\n{}", path.display());
|
||||
write!(text, "\n{}", path.display()).ok();
|
||||
} else if !file.mime.is_empty() {
|
||||
text += &format!("\n{}", file.mime);
|
||||
write!(text, "\n{}", file.mime).ok();
|
||||
} else {
|
||||
text += "\n???";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user