Skip to content

Commit

Permalink
Fix clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
bheisler committed Aug 16, 2022
1 parent 8a93b66 commit 0941755
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ pub(crate) fn analysis<'a>(
relative_distributions,
significance_threshold: config.significance_level,
noise_threshold: config.noise_threshold,
base_iter_counts: old_sample.iteration_count.iter().copied().collect(),
base_sample_times: old_sample.sample_values.iter().copied().collect(),
base_iter_counts: old_sample.iteration_count.to_vec(),
base_sample_times: old_sample.sample_values.to_vec(),
base_avg_times,
base_estimates: old_estimates.clone(),
})
Expand Down
12 changes: 1 addition & 11 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Default for Colors {
}
}

#[derive(Deserialize, Debug)]
#[derive(Deserialize, Debug, Default)]
#[serde(default)]
/// Struct to hold the various configuration settings that we can read from the TOML config file.
struct TomlConfig {
Expand All @@ -77,16 +77,6 @@ struct TomlConfig {
/// colorblindness, or just to make things look prettier.
pub colors: Colors,
}
impl Default for TomlConfig {
fn default() -> Self {
TomlConfig {
criterion_home: None,
output_format: None,
plotting_backend: None,
colors: Default::default(),
}
}
}

#[derive(Debug)]
pub enum OutputFormat {
Expand Down
14 changes: 6 additions & 8 deletions src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ pub struct Connection {
socket: TcpStream,
receive_buffer: Vec<u8>,
send_buffer: Vec<u8>,

criterion_rs_version: [u8; 3],
protocol_version: u16,
protocol_format: ProtocolFormat,
// criterion_rs_version: [u8; 3],
// protocol_version: u16,
// protocol_format: ProtocolFormat,
}
impl Connection {
/// Perform the connection handshake and wrap the TCP stream in a Connection object if successful.
Expand Down Expand Up @@ -103,10 +102,9 @@ impl Connection {
socket,
receive_buffer: vec![],
send_buffer: vec![],

criterion_rs_version,
protocol_version,
protocol_format,
// criterion_rs_version,
// protocol_version,
// protocol_format,
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/plot/gnuplot_backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mod summary;
mod t_test;

fn gnuplot_escape(string: &str) -> String {
string.replace("_", "\\_").replace("'", "''")
string.replace('_', "\\_").replace('\'', "''")
}

static DEFAULT_FONT: &str = "Helvetica";
Expand Down

0 comments on commit 0941755

Please sign in to comment.