report: inline errors in writeln!
Fixes the clippy lint: ``` warning: `to_string` applied to a type that implements `Display` in `writeln!` args --> src/server/report.rs:141:72 | 141 | let _ = writeln!(out, "error during read-dir - {}", err.to_string()); | ^^^^^^^^^^^^ help: remove this | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args ``` Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
parent
42624404e7
commit
c65fee708f
@ -126,9 +126,8 @@ fn get_directory_content(path: impl AsRef<Path>) -> String {
|
||||
Ok(iter) => iter,
|
||||
Err(err) => {
|
||||
return format!(
|
||||
"`$ cat '{}*'`\n```\n# read dir failed - {}\n```",
|
||||
"`$ cat '{}*'`\n```\n# read dir failed - {err}\n```",
|
||||
path.as_ref().display(),
|
||||
err.to_string(),
|
||||
);
|
||||
}
|
||||
};
|
||||
@ -138,7 +137,7 @@ fn get_directory_content(path: impl AsRef<Path>) -> String {
|
||||
let entry = match entry {
|
||||
Ok(entry) => entry,
|
||||
Err(err) => {
|
||||
let _ = writeln!(out, "error during read-dir - {}", err.to_string());
|
||||
let _ = writeln!(out, "error during read-dir - {err}");
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user