Skip to content

Commit 4ff95c3

Browse files
authored
Update Rust edition to 2024 (#153)
**Stack**: - #156 - #155 - #154 - #153⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
1 parent 27f024b commit 4ff95c3

File tree

10 files changed

+18
-16
lines changed

10 files changed

+18
-16
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ members = [
88

99
[workspace.package]
1010
version = "0.4.0"
11-
edition = "2021"
11+
edition = "2024"
1212

1313
[workspace.dependencies]
1414
anyhow = "1.0.95"

crates/cairo-coverage-core/benches/benchmarks/starknet_staking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::benchmarks::{config, run_options, trace_files_for_benches};
2-
use criterion::{criterion_group, Criterion};
2+
use criterion::{Criterion, criterion_group};
33
use std::hint::black_box;
44

55
const PROJECT_NAME: &str = "starknet-staking";

crates/cairo-coverage-core/src/build/coverage_input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::loading::execution_data::ExecutionData;
77
use anyhow::Result;
88
use cairo_lang_sierra::program::Program;
99
use cairo_lang_sierra_to_casm::compiler::{CairoProgramDebugInfo, SierraToCasmConfig};
10-
use cairo_lang_sierra_to_casm::metadata::{calc_metadata, MetadataComputationConfig};
10+
use cairo_lang_sierra_to_casm::metadata::{MetadataComputationConfig, calc_metadata};
1111

1212
/// All necessary data for the coverage analysis.
1313
#[derive(Clone)]

crates/cairo-coverage-core/src/build/executed_statement_count.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn points_to_different_statement(
5252
last_idx: Option<&StatementIdx>,
5353
current_idx: StatementIdx,
5454
) -> bool {
55-
last_idx.map_or(true, |last_idx| {
55+
last_idx.is_none_or(|last_idx| {
5656
statement_information_map.get(last_idx) != statement_information_map.get(&current_idx)
5757
})
5858
}

crates/cairo-coverage-core/src/build/filter/ignore_matcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::build::filter::statement_category_filter::VIRTUAL_FILE_REGEX;
22
use anyhow::{Error, Result};
33
use camino::{Utf8Path, Utf8PathBuf};
4-
use ignore::gitignore::Gitignore;
54
use ignore::Match;
5+
use ignore::gitignore::Gitignore;
66

77
const CAIRO_COVERAGE_IGNORE: &str = ".cairo-coverage-ignore";
88

crates/cairo-coverage-core/src/hashmap_utils/merge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::collections::hash_map::Entry;
21
use std::collections::HashMap;
2+
use std::collections::hash_map::Entry;
33
use std::hash::Hash;
44

55
/// Trait for merging two values

crates/cairo-coverage/src/args/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::{ensure, Result};
1+
use anyhow::{Result, ensure};
22
use camino::Utf8PathBuf;
33
use clap::{Parser, ValueEnum};
44

crates/cairo-coverage/src/commands/clean.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ pub fn run(
4141
mod tests {
4242
use super::super::clean;
4343
use super::CleanArgs;
44-
use assert_fs::fixture::PathChild;
4544
use assert_fs::TempDir;
45+
use assert_fs::fixture::PathChild;
4646
use cairo_coverage_test_utils::{CreateFile, Utf8PathBufConversion};
4747

4848
#[test]

crates/cairo-coverage/tests/e2e/general.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ fn simple_with_tests() {
1818

1919
#[test]
2020
fn simple_with_output_path() {
21-
assert!(TestProject::new("simple")
22-
.coverage_args(&["--output-path", "custom_output.lcov"])
23-
.run()
24-
.dir()
25-
.child("custom_output.lcov")
26-
.exists());
21+
assert!(
22+
TestProject::new("simple")
23+
.coverage_args(&["--output-path", "custom_output.lcov"])
24+
.run()
25+
.dir()
26+
.child("custom_output.lcov")
27+
.exists()
28+
);
2729
}
2830

2931
#[test]

crates/cairo-coverage/tests/helpers/test_project.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use assert_fs::fixture::PathCopy;
21
use assert_fs::TempDir;
2+
use assert_fs::fixture::PathCopy;
33
use cairo_coverage_test_utils::read_files_from_dir;
44
use camino::Utf8PathBuf;
5-
use snapbox::cmd::{cargo_bin, Command as SnapboxCommand};
5+
use snapbox::cmd::{Command as SnapboxCommand, cargo_bin};
66
use std::fs;
77
use std::path::PathBuf;
88
use which::which;

0 commit comments

Comments
 (0)