Fix some warnings in future Rust nightlies

This commit is contained in:
Simon Sapin 2020-01-02 16:41:47 +01:00
parent 7281336116
commit fdcc7653f2
8 changed files with 20 additions and 45 deletions

View file

@ -7,7 +7,6 @@ use heartbeats_simple::HeartbeatPow as Heartbeat;
use profile_traits::time::ProfilerCategory;
use std::collections::HashMap;
use std::env::var_os;
use std::error::Error;
use std::fs::File;
use std::path::Path;
@ -85,7 +84,7 @@ fn open_heartbeat_log<P: AsRef<Path>>(name: P) -> Option<File> {
match File::create(name) {
Ok(f) => Some(f),
Err(e) => {
warn!("Failed to open heartbeat log: {}", Error::description(&e));
warn!("Failed to open heartbeat log: {}", e);
None
},
}
@ -138,7 +137,7 @@ fn maybe_create_heartbeat(
fn log_heartbeat_records(hb: &mut Heartbeat) {
match hb.log_to_buffer_index() {
Ok(_) => (),
Err(e) => warn!("Failed to write heartbeat log: {}", Error::description(&e)),
Err(e) => warn!("Failed to write heartbeat log: {}", e),
}
}

View file

@ -19,7 +19,6 @@ use servo_config::opts::OutputOptions;
use std::borrow::ToOwned;
use std::cmp::Ordering;
use std::collections::{BTreeMap, HashMap};
use std::error::Error;
use std::fs::File;
use std::io::{self, Write};
use std::path::Path;
@ -397,11 +396,7 @@ impl Profiler {
Some(OutputOptions::FileName(ref filename)) => {
let path = Path::new(&filename);
let mut file = match File::create(&path) {
Err(e) => panic!(
"Couldn't create {}: {}",
path.display(),
Error::description(&e)
),
Err(e) => panic!("Couldn't create {}: {}", path.display(), e),
Ok(file) => file,
};
write!(