summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2018-10-24 14:45:20 +0200
committerLinus Färnstrand <linus@mullvad.net>2018-10-24 23:34:33 +0200
commit737a2580f9cc0bd471943f035e453ade04c910f1 (patch)
treeabe32d6333f7c13e5dcd68d0133b6d72cb48d2a3
parentc22962d1422c0c415d35c0068efe53124dd98aa9 (diff)
downloadmullvadvpn-737a2580f9cc0bd471943f035e453ade04c910f1.tar.xz
mullvadvpn-737a2580f9cc0bd471943f035e453ade04c910f1.zip
Fix clippy lints in problem-report
-rw-r--r--mullvad-problem-report/src/main.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/mullvad-problem-report/src/main.rs b/mullvad-problem-report/src/main.rs
index c1920f9bff..022d93bda1 100644
--- a/mullvad-problem-report/src/main.rs
+++ b/mullvad-problem-report/src/main.rs
@@ -161,11 +161,11 @@ fn run() -> Result<()> {
if let Some(collect_matches) = matches.subcommand_matches("collect") {
let redact_custom_strings = collect_matches
.values_of_lossy("redact")
- .unwrap_or(Vec::new());
+ .unwrap_or_else(Vec::new);
let extra_logs = collect_matches
.values_of_os("extra_logs")
.map(|os_values| os_values.map(Path::new).collect())
- .unwrap_or(Vec::new());
+ .unwrap_or_else(Vec::new);
let output_path = Path::new(collect_matches.value_of_os("output").unwrap());
collect_report(&extra_logs, output_path, redact_custom_strings)
} else if let Some(send_matches) = matches.subcommand_matches("send") {
@@ -209,7 +209,7 @@ fn collect_report(
problem_report.add_logs(extra_logs);
- write_problem_report(&output_path, problem_report)
+ write_problem_report(&output_path, &problem_report)
.chain_err(|| ErrorKind::WriteReportError(output_path.to_path_buf()))
}
@@ -267,7 +267,7 @@ fn send_problem_report(user_email: &str, user_message: &str, report_path: &Path)
.chain_err(|| ErrorKind::RpcError)
}
-fn write_problem_report(path: &Path, problem_report: ProblemReport) -> io::Result<()> {
+fn write_problem_report(path: &Path, problem_report: &ProblemReport) -> io::Result<()> {
let file = File::create(path)?;
let mut permissions = file.metadata()?.permissions();
permissions.set_readonly(true);