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:
Maximiliano Sandoval 2024-02-13 10:53:19 +01:00 committed by Fabian Grünbichler
parent 42624404e7
commit c65fee708f

View File

@ -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;
}
};