Skip to content

Commit d388d91

Browse files
alexle0nteLuni-4
authored andcommitted
Upgrade to Rust 2024 edition
1 parent 5385556 commit d388d91

32 files changed

+76
-76
lines changed

.pre-commit-audit-config.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ repos:
77
name: audit
88
language: system
99
files: 'Cargo\.lock|Cargo\.toml$'
10-
# FIXME
11-
# RUSTSEC-2021-0131 --> https://rustsec.org/advisories/RUSTSEC-2021-0131
12-
# RUSTSEC-2021-0124 --> https://rustsec.org/advisories/RUSTSEC-2021-0124
13-
entry: cargo audit --ignore RUSTSEC-2021-0131 --ignore RUSTSEC-2021-0124
10+
entry: cargo audit
1411
pass_filenames: false
1512

1613
default_language_version:

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ repos:
1414
- id: taskcluster_yml
1515
- repo: local
1616
hooks:
17-
- id: fmt
18-
name: fmt
19-
language: system
20-
files: '\.rs$'
21-
exclude: '.*/templates/.*\.rs$'
22-
entry: cargo fmt -- --check --verbose
17+
# FIXME: Uncomment when fmt is fixed
18+
# - id: fmt
19+
# name: fmt
20+
# language: system
21+
# files: '\.rs$'
22+
# exclude: '.*/templates/.*\.rs$'
23+
# entry: cargo fmt -- --check --verbose
2324

2425
- id: clippy
2526
name: clippy

.taskcluster.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ tasks:
5555
python3 -m venv myenv
5656
. myenv/bin/activate
5757
pip3 install --quiet pre-commit
58+
# FIXME: Remove the line below when fmt is fixed in .pre-commit-config.yaml
59+
cargo fmt -- --check --verbose
5860
pre-commit run -a --show-diff-on-failure
5961
pre-commit run --show-diff-on-failure -c .pre-commit-audit-config.yaml
6062
cargo test --workspace --verbose --all-features --no-fail-fast -- --nocapture

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "rust-code-analysis"
33
version = "0.0.25"
44
authors = ["Calixte Denizet <cdenizet@mozilla.com>"]
5-
edition = "2021"
5+
edition = "2024"
66
repository = "https://github.com/mozilla/rust-code-analysis"
77
documentation = "https://docs.rs/rust-code-analysis/"
88
readme = "README.md"

enums/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "enums"
33
version = "0.0.1"
44
authors = ["Calixte Denizet <cdenizet@mozilla.com>"]
5-
edition = "2021"
5+
edition = "2024"
66

77
[dependencies]
88
clap = { version = "^4.0", features = ["derive"] }

rust-code-analysis-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "rust-code-analysis-cli"
33
version = "0.0.25"
44
authors = ["Calixte Denizet <cdenizet@mozilla.com>"]
55
repository = "https://github.com/mozilla/rust-code-analysis/blob/master/rust-code-analysis-cli/"
6-
edition = "2021"
6+
edition = "2024"
77
keywords = ["metrics"]
88
description = "Tool to compute and export code metrics"
99
license = "MPL-2.0"

rust-code-analysis-cli/src/formats.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::fs::{create_dir_all, File};
1+
use std::fs::{File, create_dir_all};
22
use std::io::Write;
33
use std::path::{Path, PathBuf};
44
use std::str::FromStr;
@@ -94,11 +94,7 @@ fn handle_path(path: PathBuf, output_path: &Path, extension: &str) -> PathBuf {
9494
.iter()
9595
.map(|os_str| {
9696
let s_str = os_str.to_str().unwrap();
97-
if s_str == ".." {
98-
"."
99-
} else {
100-
s_str
101-
}
97+
if s_str == ".." { "." } else { s_str }
10298
})
10399
.collect();
104100

rust-code-analysis-cli/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
mod formats;
22

33
use std::cmp::Ordering;
4-
use std::collections::{hash_map, HashMap};
4+
use std::collections::{HashMap, hash_map};
55
use std::path::{Path, PathBuf};
66
use std::process;
77
use std::sync::{Arc, Mutex};
88
use std::thread::available_parallelism;
99

10-
use clap::builder::{PossibleValuesParser, TypedValueParser};
1110
use clap::Parser;
11+
use clap::builder::{PossibleValuesParser, TypedValueParser};
1212
use globset::{Glob, GlobSet, GlobSetBuilder};
1313

1414
use formats::Format;

rust-code-analysis-web/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "rust-code-analysis-web"
33
version = "0.0.25"
44
authors = ["Calixte Denizet <cdenizet@mozilla.com>"]
5-
edition = "2021"
5+
edition = "2024"
66
repository = "https://github.com/mozilla/rust-code-analysis/tree/master/rust-code-analysis-web"
77
keywords = ["metrics"]
88
description = "Run a web service to compute and export code metrics"

rust-code-analysis-web/src/web/comment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use serde::{Deserialize, Serialize};
22

3-
use rust_code_analysis::{rm_comments, Callback, ParserTrait};
3+
use rust_code_analysis::{Callback, ParserTrait, rm_comments};
44

55
/// Payload containing source code with comments to be removed.
66
#[derive(Debug, Deserialize, Serialize)]

0 commit comments

Comments
 (0)