diff --git a/.github/workflows/sightglass.yml b/.github/workflows/sightglass.yml index 39624382..2fa2b08c 100644 --- a/.github/workflows/sightglass.yml +++ b/.github/workflows/sightglass.yml @@ -14,15 +14,16 @@ env: REVISION: "v38.0.3" jobs: - format: + format-and-clippy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: submodules: true - run: rustup update - - run: rustup component add rustfmt + - run: rustup component add rustfmt clippy - run: cargo fmt --all -- --check + - run: cargo clippy --all-targets --all-features -- -D warnings test: runs-on: ${{ matrix.os }} diff --git a/crates/analysis/src/effect_size.rs b/crates/analysis/src/effect_size.rs index 6654f680..06c41add 100644 --- a/crates/analysis/src/effect_size.rs +++ b/crates/analysis/src/effect_size.rs @@ -18,7 +18,7 @@ pub fn calculate<'a>( measurements: &[Measurement<'a>], ) -> Result>> { anyhow::ensure!( - 0.0 <= significance_level && significance_level <= 1.0, + (0.0..=1.0).contains(&significance_level), "The significance_level must be between 0.0 and 1.0. \ Typical values are 0.05 and 0.01 (i.e. 95% and 99% confidence). \ Found {}.", diff --git a/crates/analysis/src/keys.rs b/crates/analysis/src/keys.rs index 7b5f1c5b..fbf271df 100644 --- a/crates/analysis/src/keys.rs +++ b/crates/analysis/src/keys.rs @@ -94,11 +94,11 @@ pub struct Key<'a> { impl Key<'_> { /// Does the given measurement match this key? pub fn matches(&self, m: &Measurement) -> bool { - self.arch.as_ref().map_or(true, |x| *x == m.arch) - && self.engine.as_ref().map_or(true, |x| *x == m.engine) - && self.wasm.as_ref().map_or(true, |x| *x == m.wasm) - && self.phase.as_ref().map_or(true, |x| *x == m.phase) - && self.event.as_ref().map_or(true, |x| *x == m.event) + self.arch.as_ref().is_none_or(|x| *x == m.arch) + && self.engine.as_ref().is_none_or(|x| *x == m.engine) + && self.wasm.as_ref().is_none_or(|x| *x == m.wasm) + && self.phase.as_ref().is_none_or(|x| *x == m.phase) + && self.event.as_ref().is_none_or(|x| *x == m.event) } } diff --git a/crates/analysis/src/summarize.rs b/crates/analysis/src/summarize.rs index 86fd248b..6b7e189e 100644 --- a/crates/analysis/src/summarize.rs +++ b/crates/analysis/src/summarize.rs @@ -6,7 +6,7 @@ use std::io::Write; /// Summarize measurements grouped by: architecture, engine, benchmark file, phase and event. pub fn calculate<'a>(measurements: &[Measurement<'a>]) -> Vec> { let mut summaries = Vec::new(); - for k in KeyBuilder::all().keys(&measurements) { + for k in KeyBuilder::all().keys(measurements) { let mut grouped_counts: Vec<_> = measurements .iter() .filter(|m| k.matches(m)) diff --git a/crates/build/src/wasm.rs b/crates/build/src/wasm.rs index 67493ff4..904aa191 100644 --- a/crates/build/src/wasm.rs +++ b/crates/build/src/wasm.rs @@ -12,7 +12,6 @@ use std::{ }; use thiserror::Error; use wasmparser::{Import, Payload, TypeRef}; -use wasmprinter; pub struct WasmBenchmark(PathBuf); @@ -30,31 +29,33 @@ impl WasmBenchmark { pub fn is_valid(&self) -> Result<(), ValidationError> { // Check that the file actually exists. if !self.0.exists() { - return ValidationErrorKind::DoesNotExist.with(&self); + return ValidationErrorKind::DoesNotExist.with(self); } // Check that the contents are readable. let bytes = match fs::read(&self.0) { Ok(b) => b, Err(_) => { - return ValidationErrorKind::Unreadable.with(&self); + return ValidationErrorKind::Unreadable.with(self); } }; // Check that it contains valid Wasm. - let mut features = wasmparser::WasmFeatures::default(); - features.simd = true; + let features = wasmparser::WasmFeatures { + simd: true, + ..Default::default() + }; let mut validator = wasmparser::Validator::new_with_features(features); - if let Err(_) = validator.validate_all(&bytes) { - return ValidationErrorKind::InvalidWasm.with(&self); + if validator.validate_all(&bytes).is_err() { + return ValidationErrorKind::InvalidWasm.with(self); } // Check that it has the expected imports/exports. if !has_import_function(&bytes, "bench", "start").unwrap() { - return ValidationErrorKind::MissingImport("bench.end").with(&self); + return ValidationErrorKind::MissingImport("bench.start").with(self); } if !has_import_function(&bytes, "bench", "end").unwrap() { - return ValidationErrorKind::MissingImport("bench.end").with(&self); + return ValidationErrorKind::MissingImport("bench.end").with(self); } Ok(()) @@ -80,7 +81,7 @@ impl WasmBenchmark { )); let mut file = File::create(&wat)?; file.write_all(wasmprinter::print_file(&self.0)?.as_bytes())?; - file.write(&['\n' as u8])?; // Append a newline on the end. + file.write_all(b"\n")?; // Append a newline on the end. Ok(wat) } } @@ -91,9 +92,9 @@ impl AsRef for WasmBenchmark { } } -impl Into for WasmBenchmark { - fn into(self) -> PathBuf { - self.0 +impl From for PathBuf { + fn from(val: WasmBenchmark) -> Self { + val.0 } } @@ -134,25 +135,20 @@ impl Display for WasmBenchmark { fn has_import_function(bytes: &[u8], expected_module: &str, expected_field: &str) -> Result { let parser = wasmparser::Parser::new(0); - for payload in parser.parse_all(&bytes) { - match payload? { - Payload::ImportSection(imports) => { - for import in imports { - match import? { - Import { - module, - name: field, - ty: TypeRef::Func(_), - } => { - if module == expected_module && field == expected_field { - return Ok(true); - } - } - _ => {} + for payload in parser.parse_all(bytes) { + if let Payload::ImportSection(imports) = payload? { + for import in imports { + if let Import { + module, + name: field, + ty: TypeRef::Func(_), + } = import? + { + if module == expected_module && field == expected_field { + return Ok(true); } } } - _ => {} } } Ok(false) diff --git a/crates/cli/src/benchmark.rs b/crates/cli/src/benchmark.rs index 85e563c8..3d26dc42 100644 --- a/crates/cli/src/benchmark.rs +++ b/crates/cli/src/benchmark.rs @@ -25,7 +25,7 @@ pub struct BenchmarkCommand { /// The path to the file(s) to benchmark. This accepts one or more: /// /// - `*.wasm` files: individual benchmarks that meet the requirements - /// outlined in `benchmarks/README.md` + /// outlined in `benchmarks/README.md` /// /// - `*.suite` files: a file containing a newline-delimited list of /// benchmarks to execute. A `*.suite` file may contain `#`-prefixed line @@ -180,7 +180,7 @@ impl BenchmarkCommand { log::info!("Using working directory: {}", working_dir.display()); // Read the Wasm bytes. - let bytes = fs::read(&wasm_file).context("Attempting to read Wasm bytes")?; + let bytes = fs::read(wasm_file).context("Attempting to read Wasm bytes")?; log::debug!("Wasm benchmark size: {} bytes", bytes.len()); let wasm_hash = { @@ -296,11 +296,11 @@ impl BenchmarkCommand { .with_context(|| "expected the benchmark file to have an extension")? .to_str() .with_context(|| "expected the benchmark file to have a printable name")?; - let mut stdout_expected = wasm_file_dir.join(format!("{}.stdout.expected", benchmark_name)); + let mut stdout_expected = wasm_file_dir.join(format!("{benchmark_name}.stdout.expected")); if !stdout_expected.exists() { stdout_expected = wasm_file_dir.join("default.stdout.expected"); } - let mut stderr_expected = wasm_file_dir.join(format!("{}.stderr.expected", benchmark_name)); + let mut stderr_expected = wasm_file_dir.join(format!("{benchmark_name}.stderr.expected")); if !stderr_expected.exists() { stderr_expected = wasm_file_dir.join("default.stderr.expected"); } @@ -365,8 +365,7 @@ impl BenchmarkCommand { .args( self.measures .iter() - .map(|m| ["--measure".to_string(), m.to_string()]) - .flatten(), + .flat_map(|m| ["--measure".to_string(), m.to_string()]), ) .arg("--raw") .arg("--output-format") @@ -387,7 +386,7 @@ impl BenchmarkCommand { } if let Some(flags) = &self.engine_flags { - command.arg(format!("--engine-flags={}", flags)); + command.arg(format!("--engine-flags={flags}")); } command.arg("--").arg(&wasm); @@ -500,7 +499,7 @@ pub fn check_engine_path(engine: &str) -> Result { /// `stderr`) is the same as the `expected` output. fn compare_output_file(wasm: &Path, actual: &Path, expected: &Path) -> Result<()> { if expected.exists() { - let expected_data = std::fs::read_to_string(&expected) + let expected_data = std::fs::read_to_string(expected) .with_context(|| format!("failed to read `{}`", expected.display()))?; let stdout_actual_data = std::fs::read_to_string(actual) .with_context(|| format!("failed to read `{}`", actual.display()))?; @@ -540,7 +539,7 @@ mod tests { display_summaries(&measurements, &mut output)?; let actual = String::from_utf8(output)?; - eprintln!("=== Actual ===\n{}", actual); + eprintln!("=== Actual ===\n{actual}"); let expected = r#" compilation @@ -574,7 +573,7 @@ execution [3556483 3729210.70 4349778] /tmp/old_backend_2.so [3639688 4025470.30 5782529] /tmp/old_backend_3.so "#; - eprintln!("=== Expected ===\n{}", expected); + eprintln!("=== Expected ===\n{expected}"); assert_eq!(actual.trim(), expected.trim()); Ok(()) @@ -589,7 +588,7 @@ execution display_effect_size(&measurements, 0.05, &mut output)?; let actual = String::from_utf8(output)?; - eprintln!("=== Actual ===\n{}", actual); + eprintln!("=== Actual ===\n{actual}"); let expected = r#" compilation :: cycles :: benchmarks/pulldown-cmark/benchmark.wasm @@ -642,7 +641,7 @@ instantiation :: nanoseconds :: benchmarks/pulldown-cmark/benchmark.wasm [65929 71540.70 112190] new_backend.so [61849 69023.59 115015] old_backend.so "#; - eprintln!("=== Expected ===\n{}", expected); + eprintln!("=== Expected ===\n{expected}"); assert_eq!(actual.trim(), expected.trim()); Ok(()) diff --git a/crates/cli/tests/all/benchmark.rs b/crates/cli/tests/all/benchmark.rs index f2ffa88d..d909b88b 100644 --- a/crates/cli/tests/all/benchmark.rs +++ b/crates/cli/tests/all/benchmark.rs @@ -81,7 +81,7 @@ fn benchmark_json() { .assert(); let stdout = std::str::from_utf8(&assert.get_output().stdout).unwrap(); - eprintln!("=== stdout ===\n{}\n===========", stdout); + eprintln!("=== stdout ===\n{stdout}\n==========="); assert!(serde_json::from_str::(stdout).is_ok()); assert @@ -109,7 +109,7 @@ fn benchmark_csv() { .assert(); let stdout = std::str::from_utf8(&assert.get_output().stdout).unwrap(); - eprintln!("=== stdout ===\n{}\n===========", stdout); + eprintln!("=== stdout ===\n{stdout}\n==========="); let mut reader = csv::Reader::from_reader(stdout.as_bytes()); for measurement in reader.deserialize::>() { drop(measurement.unwrap()); @@ -174,12 +174,12 @@ fn benchmark_effect_size() -> anyhow::Result<()> { .assert() .success() .stdout( - predicate::str::contains(&format!("compilation :: cycles :: {}", benchmark("noop"))) - .and(predicate::str::contains(&format!( + predicate::str::contains(format!("compilation :: cycles :: {}", benchmark("noop"))) + .and(predicate::str::contains(format!( "instantiation :: cycles :: {}", benchmark("noop") ))) - .and(predicate::str::contains(&format!( + .and(predicate::str::contains(format!( "execution :: cycles :: {}", benchmark("noop") ))) diff --git a/crates/cli/tests/all/fingerprint.rs b/crates/cli/tests/all/fingerprint.rs index 2df9886c..6814fa00 100644 --- a/crates/cli/tests/all/fingerprint.rs +++ b/crates/cli/tests/all/fingerprint.rs @@ -14,7 +14,7 @@ fn fingerprint_machine() { .assert(); let stdout = std::str::from_utf8(&assert.get_output().stdout).unwrap(); - eprintln!("=== stdout ===\n{}\n===========", stdout); + eprintln!("=== stdout ===\n{stdout}\n==========="); assert!(serde_json::from_str::(stdout).is_ok()); } @@ -30,7 +30,7 @@ fn fingerprint_benchmark() { .assert(); let stdout = std::str::from_utf8(&assert.get_output().stdout).unwrap(); - eprintln!("=== stdout ===\n{}\n===========", stdout); + eprintln!("=== stdout ===\n{stdout}\n==========="); let mut reader = csv::Reader::from_reader(stdout.as_bytes()); for measurement in reader.deserialize::() { drop(measurement.unwrap()); @@ -58,7 +58,7 @@ fn fingerprint_engine() { .assert(); let stdout = std::str::from_utf8(&assert.get_output().stdout).unwrap(); - eprintln!("=== stdout ===\n{}\n===========", stdout); + eprintln!("=== stdout ===\n{stdout}\n==========="); let mut reader = csv::Reader::from_reader(stdout.as_bytes()); for measurement in reader.deserialize::() { drop(measurement.unwrap()); @@ -73,7 +73,7 @@ fn fingerprint_engine() { .and(contains(r#""id":"wasmtime-"#)) .and(contains(r#""name":"wasmtime""#)) .and(contains(r#""datetime":"20"#)) - .and(contains(format!(r#""path":"{}""#, escaped_engine_path))) + .and(contains(format!(r#""path":"{escaped_engine_path}""#))) .and(contains(r#""buildinfo":"NAME=wasmtime"#)) .and(ends_with("}")), ) diff --git a/crates/cli/tests/all/upload.rs b/crates/cli/tests/all/upload.rs index 02879f00..d9f3459f 100644 --- a/crates/cli/tests/all/upload.rs +++ b/crates/cli/tests/all/upload.rs @@ -22,7 +22,7 @@ fn upload_dryrun() { // Gather up the logged output from stderr. let stderr = std::str::from_utf8(&assert.get_output().stderr).unwrap(); - eprintln!("=== stderr ===\n{}\n===========", stderr); + eprintln!("=== stderr ===\n{stderr}\n==========="); // Gather the fingerprints of the system under test. let engine = sightglass_fingerprint::Engine::fingerprint(test_engine()).unwrap(); diff --git a/crates/cli/tests/all/util.rs b/crates/cli/tests/all/util.rs index 4b05a70f..0affab49 100644 --- a/crates/cli/tests/all/util.rs +++ b/crates/cli/tests/all/util.rs @@ -24,7 +24,6 @@ pub fn test_engine() -> PathBuf { BUILD_WASMTIME.call_once(|| { if engine_path.is_file() { // Use the already built engine library. - return; } else { // Use this instead of `eprintln!` to avoid `cargo test`'s stdio // capturing. @@ -67,5 +66,5 @@ pub fn sightglass_cli_benchmark() -> Command { /// Get the benchmark path for the benchmark with the given name. pub fn benchmark(benchmark_name: &str) -> String { - format!("../../benchmarks/{}/benchmark.wasm", benchmark_name).into() + format!("../../benchmarks/{benchmark_name}/benchmark.wasm") } diff --git a/crates/data/src/format.rs b/crates/data/src/format.rs index 2fcd103e..7a8e54eb 100644 --- a/crates/data/src/format.rs +++ b/crates/data/src/format.rs @@ -30,7 +30,7 @@ impl Format { } /// Read a list of `T` using the selected format. - pub fn read<'de, T, R>(&self, reader: R) -> Result> + pub fn read(&self, reader: R) -> Result> where R: Read + Sized, T: DeserializeOwned, @@ -52,7 +52,7 @@ impl Format { T: Serialize, W: Write + Sized, { - Ok(match self { + match self { Format::Json => serde_json::to_writer(writer, objects)?, Format::Csv { headers } => { let mut csv = csv::WriterBuilder::new() @@ -63,7 +63,8 @@ impl Format { } csv.flush()?; } - }) + }; + Ok(()) } /// Write a list of `T` using the selected format. @@ -72,7 +73,7 @@ impl Format { T: Serialize, W: Write + Sized, { - Ok(match self { + match self { Format::Json => serde_json::to_writer(writer, &object)?, Format::Csv { headers } => { let mut csv = csv::WriterBuilder::new() @@ -81,7 +82,8 @@ impl Format { csv.serialize(&object)?; csv.flush()?; } - }) + }; + Ok(()) } } diff --git a/crates/fingerprint/src/engine.rs b/crates/fingerprint/src/engine.rs index 90cda539..aca60e70 100644 --- a/crates/fingerprint/src/engine.rs +++ b/crates/fingerprint/src/engine.rs @@ -81,8 +81,8 @@ pub fn get_buildinfo_path_from_engine_path(engine_path: &Path) -> Result Option { - let re = Regex::new(&format!("(?m)^ *{} *= *([[[:alnum:]]-_:]+) *", key)).unwrap(); - for cap in re.captures_iter(buildinfo) { + let re = Regex::new(&format!("(?m)^ *{key} *= *([[[:alnum:]]-_:]+) *")).unwrap(); + if let Some(cap) = re.captures_iter(buildinfo).next() { return Some(cap[1].to_string()); } None diff --git a/crates/fingerprint/src/hash.rs b/crates/fingerprint/src/hash.rs index d48f92b1..e0ccb377 100644 --- a/crates/fingerprint/src/hash.rs +++ b/crates/fingerprint/src/hash.rs @@ -24,7 +24,7 @@ pub(crate) fn hexify(bytes: &[u8]) -> String { use std::fmt::Write; let mut s = String::new(); for byte in bytes { - write!(&mut s, "{:x}", byte).expect("unable to write byte as hex"); + write!(&mut s, "{byte:x}").expect("unable to write byte as hex"); } s } diff --git a/crates/fingerprint/src/machine.rs b/crates/fingerprint/src/machine.rs index 42c6c4ca..68e7b267 100644 --- a/crates/fingerprint/src/machine.rs +++ b/crates/fingerprint/src/machine.rs @@ -62,10 +62,7 @@ impl Machine { .to_string(); // Hash all properties into a unique identifier. - let hash = hash::string(&format!( - "{}\n{}\n{}\n{}\n{}\n{}", - name, arch, os, kernel, cpu, memory - )); + let hash = hash::string(&format!("{name}\n{arch}\n{os}\n{kernel}\n{cpu}\n{memory}")); let id = format!( "{}-{}-{}", env::consts::ARCH, diff --git a/crates/recorder/src/bench_api.rs b/crates/recorder/src/bench_api.rs index 17f82115..622cee02 100644 --- a/crates/recorder/src/bench_api.rs +++ b/crates/recorder/src/bench_api.rs @@ -78,6 +78,7 @@ impl<'a, 'b, 'c, M> Engine<'a, 'b, 'c, M> { /// Construct a new engine from the given `BenchApi`. // NB: take a mutable reference to the `BenchApi` so that no one else can // call its API methods out of order. + #[allow(clippy::too_many_arguments)] pub fn new( bench_api: &'a mut BenchApi<'b>, working_dir: &Path, diff --git a/crates/recorder/src/measure/counters.rs b/crates/recorder/src/measure/counters.rs index d379c547..fcfa5708 100644 --- a/crates/recorder/src/measure/counters.rs +++ b/crates/recorder/src/measure/counters.rs @@ -21,6 +21,12 @@ pub struct CounterMeasure { task_clock: Counter, } +impl Default for CounterMeasure { + fn default() -> Self { + Self::new() + } +} + impl CounterMeasure { pub fn new() -> Self { let mut group = Group::new().expect( diff --git a/crates/recorder/src/measure/cycles.rs b/crates/recorder/src/measure/cycles.rs index 7b8c7d6d..efdcd458 100644 --- a/crates/recorder/src/measure/cycles.rs +++ b/crates/recorder/src/measure/cycles.rs @@ -19,6 +19,12 @@ lazy_static! { pub struct CycleMeasure(Option); +impl Default for CycleMeasure { + fn default() -> Self { + Self::new() + } +} + impl CycleMeasure { pub fn new() -> Self { Self(None) diff --git a/crates/recorder/src/measure/insts.rs b/crates/recorder/src/measure/insts.rs index 668f539f..4fc5da47 100644 --- a/crates/recorder/src/measure/insts.rs +++ b/crates/recorder/src/measure/insts.rs @@ -8,6 +8,12 @@ use sightglass_data::Phase; /// Measure CPU counters. pub struct InstsRetiredMeasure(Counter); +impl Default for InstsRetiredMeasure { + fn default() -> Self { + Self::new() + } +} + impl InstsRetiredMeasure { pub fn new() -> Self { let counter = Builder::new().kind(Hardware::INSTRUCTIONS).build().expect( diff --git a/crates/recorder/src/measure/noop.rs b/crates/recorder/src/measure/noop.rs index 7e5e357e..df080c5c 100644 --- a/crates/recorder/src/measure/noop.rs +++ b/crates/recorder/src/measure/noop.rs @@ -5,6 +5,13 @@ use sightglass_data::Phase; /// be used without the overhead of any measurement activity. TODO document example using `perf` and /// `start`/`end` (how to reference `NoopMeasure::start`?) pub struct NoopMeasure; + +impl Default for NoopMeasure { + fn default() -> Self { + Self::new() + } +} + impl NoopMeasure { pub fn new() -> Self { Self diff --git a/crates/recorder/src/measure/time.rs b/crates/recorder/src/measure/time.rs index 0a179ebe..0e9352c1 100644 --- a/crates/recorder/src/measure/time.rs +++ b/crates/recorder/src/measure/time.rs @@ -10,6 +10,12 @@ use sightglass_data::Phase; pub struct TimeMeasure(Option); +impl Default for TimeMeasure { + fn default() -> Self { + Self::new() + } +} + impl TimeMeasure { pub fn new() -> Self { Self(None) diff --git a/crates/recorder/src/measure/vtune.rs b/crates/recorder/src/measure/vtune.rs index 2f2036d7..fc2c56a1 100644 --- a/crates/recorder/src/measure/vtune.rs +++ b/crates/recorder/src/measure/vtune.rs @@ -17,6 +17,12 @@ lazy_static! { pub struct VTuneMeasure(Option>); +impl Default for VTuneMeasure { + fn default() -> Self { + Self::new() + } +} + impl VTuneMeasure { pub fn new() -> Self { Self(None) diff --git a/crates/upload/src/database.rs b/crates/upload/src/database.rs index 90a71b09..21fb28e3 100644 --- a/crates/upload/src/database.rs +++ b/crates/upload/src/database.rs @@ -34,7 +34,7 @@ impl Database { } /// Retrieve an object from the database, if it exists. - pub fn get<'a, T>(&self, index: &str, id: &str) -> Result + pub fn get(&self, index: &str, id: &str) -> Result where T: DeserializeOwned, { @@ -56,7 +56,7 @@ impl Database { /// return the ID without creating a new database entry /// 3. if the ID is used and the existing object does not match `object`, /// append a `!` to the ID and retry (up to 5 times). - pub fn create_if_not_exists<'a, T>(&self, index: &str, object: &T, id: &str) -> Result + pub fn create_if_not_exists(&self, index: &str, object: &T, id: &str) -> Result where T: DeserializeOwned + Serialize + PartialEq, { @@ -90,7 +90,7 @@ impl Database { where T: Serialize, { - log::debug!("Creating record in '{}' with ID {:?}", index, id); + log::debug!("Creating record in '{index}' with ID {id:?}"); let url = if let Some(id) = id { format!("{}/{}/_doc/{}", self.url, index, id) } else { @@ -116,7 +116,7 @@ impl Database { let success = response.status().is_success(); let content: HashMap = serde_json::from_slice(&response.bytes()?)?; - log::debug!("ElasticSearch response: {:?}", content); + log::debug!("ElasticSearch response: {content:?}"); if success { let id = content.get("_id").unwrap().as_str().unwrap().to_string(); @@ -160,7 +160,7 @@ impl Database { let success = response.status().is_success(); let content: HashMap = serde_json::from_slice(&response.bytes()?)?; - log::debug!("ElasticSearch response: {:?}", content); + log::debug!("ElasticSearch response: {content:?}"); if success { Ok(()) diff --git a/crates/upload/src/lib.rs b/crates/upload/src/lib.rs index dc5a0e9f..a9140112 100644 --- a/crates/upload/src/lib.rs +++ b/crates/upload/src/lib.rs @@ -123,7 +123,7 @@ pub fn upload_package( // Insert all of the measurements. for batch in package.measurements.chunks(batch_size) { let batch = batch - .into_iter() + .iter() .map(|m| { UploadMeasurement::map_and_convert( &machine, diff --git a/crates/upload/src/measurement.rs b/crates/upload/src/measurement.rs index 6459c58d..55863c38 100644 --- a/crates/upload/src/measurement.rs +++ b/crates/upload/src/measurement.rs @@ -77,7 +77,7 @@ impl<'a> UploadMeasurement<'a> { ) -> Self { let engine = engines.get(measurement.engine.as_ref()).unwrap().as_ref(); let benchmark = benchmarks.get(measurement.wasm.as_ref()).unwrap().as_ref(); - Self::convert(&machine, engine, benchmark, datetime, measurement) + Self::convert(machine, engine, benchmark, datetime, measurement) } }