[pbs-devel] [PATCH proxmox-backup] system-report: fix 'unused Result' warning

Lukas Wagner l.wagner at proxmox.com
Fri Nov 24 09:28:19 CET 2023


Signed-off-by: Lukas Wagner <l.wagner at 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






More information about the pbs-devel mailing list