summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2018-11-16 11:34:55 +0100
committerLinus Färnstrand <linus@mullvad.net>2018-11-16 13:05:08 +0100
commitdb98b919dcb5748c867359d8594896dba3459bb9 (patch)
tree35d6cae79e84afb1359b9d2457fd90ed9061cb03
parent96ccae785810d48b4d93764bc1c193e0b807b5d6 (diff)
downloadmullvadvpn-db98b919dcb5748c867359d8594896dba3459bb9.tar.xz
mullvadvpn-db98b919dcb5748c867359d8594896dba3459bb9.zip
Fix non-consuming arguments in problem-report
-rw-r--r--mullvad-problem-report/src/main.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/mullvad-problem-report/src/main.rs b/mullvad-problem-report/src/main.rs
index 9b9fc754ad..8e8fb00f67 100644
--- a/mullvad-problem-report/src/main.rs
+++ b/mullvad-problem-report/src/main.rs
@@ -199,14 +199,14 @@ fn collect_report(
other_logs.push(path);
}
}
- Err(error) => problem_report.add_error("Unable to get log path", error),
+ Err(error) => problem_report.add_error("Unable to get log path", &error),
}
}
for other_log in other_logs {
problem_report.add_log(&other_log);
}
}
- Err(error) => problem_report.add_error("Failed to list logs in log directory", error),
+ Err(error) => problem_report.add_error("Failed to list logs in log directory", &error),
};
problem_report.add_logs(extra_logs);
@@ -329,13 +329,8 @@ impl ProblemReport {
}
/// Attach an error to the report.
- pub fn add_error<S, E>(&mut self, message: S, error: E)
- where
- S: ToString,
- E: ChainedError,
- {
+ pub fn add_error(&mut self, message: &'static str, error: &impl ChainedError) {
let redacted_error = self.redact(&error.display_chain().to_string());
-
self.logs.push((message.to_string(), redacted_error));
}