Skip to content

Commit 66b9951

Browse files
kadiwa4calebcartwright
authored andcommitted
update some dependencies
1 parent 2c30fa5 commit 66b9951

File tree

4 files changed

+90
-43
lines changed

4 files changed

+90
-43
lines changed

Cargo.lock

+72-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ generic-simd = ["bytecount/generic-simd"]
3636
annotate-snippets = { version = "0.9", features = ["color"] }
3737
anyhow = "1.0"
3838
bytecount = "0.6"
39-
cargo_metadata = "0.14"
39+
cargo_metadata = "0.15.4"
4040
clap = { version = "4.2.1", features = ["derive"] }
4141
diff = "0.1"
4242
dirs = "4.0"
43-
env_logger = "0.9"
43+
env_logger = "0.10.0"
4444
getopts = "0.2"
4545
ignore = "0.4"
4646
itertools = "0.10"
@@ -51,7 +51,7 @@ serde = { version = "1.0.160", features = ["derive"] }
5151
serde_json = "1.0"
5252
term = "0.7"
5353
thiserror = "1.0.40"
54-
toml = "0.5"
54+
toml = "0.7.4"
5555
unicode-segmentation = "1.9"
5656
unicode-width = "0.1"
5757
unicode_categories = "0.1"

src/cargo-fmt/main.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use std::path::{Path, PathBuf};
1414
use std::process::Command;
1515
use std::str;
1616

17+
use cargo_metadata::Edition;
1718
use clap::{CommandFactory, Parser};
1819

1920
#[path = "test/mod.rs"]
@@ -270,7 +271,7 @@ pub struct Target {
270271
/// A kind of target (e.g., lib, bin, example, ...).
271272
kind: String,
272273
/// Rust edition for this target.
273-
edition: String,
274+
edition: Edition,
274275
}
275276

276277
impl Target {
@@ -281,7 +282,7 @@ impl Target {
281282
Target {
282283
path: canonicalized,
283284
kind: target.kind[0].clone(),
284-
edition: target.edition.clone(),
285+
edition: target.edition,
285286
}
286287
}
287288
}
@@ -506,7 +507,7 @@ fn run_rustfmt(
506507
let mut command = rustfmt_command()
507508
.stdout(stdout)
508509
.args(files)
509-
.args(&["--edition", edition])
510+
.args(&["--edition", edition.as_str()])
510511
.args(fmt_args)
511512
.spawn()
512513
.map_err(|e| match e.kind() {

src/cargo-fmt/test/targets.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use super::*;
22

33
struct ExpTarget {
44
path: &'static str,
5-
edition: &'static str,
5+
edition: Edition,
66
kind: &'static str,
77
}
88

@@ -26,7 +26,7 @@ mod all_targets {
2626
for target in exp_targets {
2727
assert!(targets.contains(&Target {
2828
path: get_path(target.path),
29-
edition: target.edition.to_owned(),
29+
edition: target.edition,
3030
kind: target.kind.to_owned(),
3131
}));
3232
}
@@ -39,17 +39,17 @@ mod all_targets {
3939
let exp_targets = vec![
4040
ExpTarget {
4141
path: "dependency-dir-name/subdep-dir-name/src/lib.rs",
42-
edition: "2018",
42+
edition: Edition::E2018,
4343
kind: "lib",
4444
},
4545
ExpTarget {
4646
path: "dependency-dir-name/src/lib.rs",
47-
edition: "2018",
47+
edition: Edition::E2018,
4848
kind: "lib",
4949
},
5050
ExpTarget {
5151
path: "src/main.rs",
52-
edition: "2018",
52+
edition: Edition::E2018,
5353
kind: "main",
5454
},
5555
];
@@ -79,32 +79,32 @@ mod all_targets {
7979
let exp_targets = vec![
8080
ExpTarget {
8181
path: "ws/a/src/main.rs",
82-
edition: "2018",
82+
edition: Edition::E2018,
8383
kind: "bin",
8484
},
8585
ExpTarget {
8686
path: "ws/b/src/main.rs",
87-
edition: "2018",
87+
edition: Edition::E2018,
8888
kind: "bin",
8989
},
9090
ExpTarget {
9191
path: "ws/c/src/lib.rs",
92-
edition: "2018",
92+
edition: Edition::E2018,
9393
kind: "lib",
9494
},
9595
ExpTarget {
9696
path: "ws/a/d/src/lib.rs",
97-
edition: "2018",
97+
edition: Edition::E2018,
9898
kind: "lib",
9999
},
100100
ExpTarget {
101101
path: "e/src/main.rs",
102-
edition: "2018",
102+
edition: Edition::E2018,
103103
kind: "main",
104104
},
105105
ExpTarget {
106106
path: "ws/a/d/f/src/lib.rs",
107-
edition: "2018",
107+
edition: Edition::E2018,
108108
kind: "lib",
109109
},
110110
];

0 commit comments

Comments
 (0)