* [pbs-devel] [PATCH proxmox-backup] system-report: fix 'unused Result' warning
@ 2023-11-24 8:28 Lukas Wagner
2023-11-24 11:22 ` Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Lukas Wagner @ 2023-11-24 8:28 UTC (permalink / raw)
To: pbs-devel
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
src/server/report.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/server/report.rs b/src/server/report.rs
index 703daa71..ea31cbf9 100644
--- a/src/server/report.rs
+++ b/src/server/report.rs
@@ -162,7 +162,11 @@ fn get_command_output(exe: &str, args: &Vec<&str>) -> String {
.trim_end()
.to_string();
if !stderr.is_empty() {
- writeln!(out, "\n```\nSTDERR:\n```\n{stderr}");
+ // Does not really make sense to append any error
+ // to 'out' - since that write would probably fail
+ // too... also, AFAICT this should never fail -
+ // in case of OOM, Rust will simply abort
+ let _ = writeln!(out, "\n```\nSTDERR:\n```\n{stderr}");
}
out
}
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [pbs-devel] [PATCH proxmox-backup] system-report: fix 'unused Result' warning
2023-11-24 8:28 [pbs-devel] [PATCH proxmox-backup] system-report: fix 'unused Result' warning Lukas Wagner
@ 2023-11-24 11:22 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-11-24 11:22 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Lukas Wagner
Am 24/11/2023 um 09:28 schrieb Lukas Wagner:
> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
> ---
> src/server/report.rs | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/server/report.rs b/src/server/report.rs
> index 703daa71..ea31cbf9 100644
> --- a/src/server/report.rs
> +++ b/src/server/report.rs
> @@ -162,7 +162,11 @@ fn get_command_output(exe: &str, args: &Vec<&str>) -> String {
> .trim_end()
> .to_string();
> if !stderr.is_empty() {
> - writeln!(out, "\n```\nSTDERR:\n```\n{stderr}");
> + // Does not really make sense to append any error
> + // to 'out' - since that write would probably fail
> + // too... also, AFAICT this should never fail -
> + // in case of OOM, Rust will simply abort
> + let _ = writeln!(out, "\n```\nSTDERR:\n```\n{stderr}");
> }
> out
> }
yikes, I actually wanted to fix that before pushing those changes out, meh.
Thanks for sending a patch, I also noticed the warning again when testing
Stefan Lendls prune job series and pushed a fix directly (without comment
as we do that quite a few times already)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-24 11:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-24 8:28 [pbs-devel] [PATCH proxmox-backup] system-report: fix 'unused Result' warning Lukas Wagner
2023-11-24 11:22 ` Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox