Skip to content

Commit f7ad264

Browse files
authored
Maintenance (#187)
1 parent 88d651c commit f7ad264

File tree

12 files changed

+207
-105
lines changed

12 files changed

+207
-105
lines changed

Cargo.lock

Lines changed: 139 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ exclude = [
1717
"test-data/",
1818
]
1919

20+
[profile.release]
21+
strip = true
22+
lto = true
23+
2024
[[bin]]
2125
name = "nvm"
2226
path = "src/main.rs"
@@ -25,7 +29,7 @@ path = "src/main.rs"
2529

2630
[dependencies]
2731
anyhow = "1.0.66"
28-
clap = { version = "3.2.23", features = ["derive", "env", "cargo"] }
32+
clap = { version = "4.0.29", features = ["derive", "env", "cargo"] }
2933
dialoguer = "0.10.2"
3034
dirs = "4.0.0"
3135
itertools = "0.10.5"

src/archives.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@ pub fn extract_archive(bytes: Response, path: &Path) -> Result<()> {
3636

3737
if item.is_dir() && !new_path.exists() {
3838
create_dir_all(&new_path)
39-
.unwrap_or_else(|_| panic!("Could not create new folder: {:?}", new_path));
39+
.unwrap_or_else(|_| panic!("Could not create new folder: {new_path:?}"));
4040
}
4141

4242
if item.is_file() {
4343
let mut file = File::create(&*new_path)?;
44-
copy(&mut item, &mut file)
45-
.unwrap_or_else(|_| panic!("Couldn't write to {:?}", new_path));
44+
copy(&mut item, &mut file).unwrap_or_else(|_| panic!("Couldn't write to {new_path:?}"));
4645
}
4746
}
4847

src/files/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub fn get_version_file() -> Option<VersionFile> {
5151
let contents = fs::read_to_string(existing_file);
5252

5353
if let Ok(contents) = contents {
54-
let parse_result = Range::parse(&contents);
54+
let parse_result = Range::parse(contents);
5555

5656
if let Ok(parse_result) = parse_result {
5757
return Some(VersionFile::Nvmrc(parse_result));
@@ -75,7 +75,7 @@ pub fn get_version_file() -> Option<VersionFile> {
7575
.and_then(|line| line.split(' ').nth(1));
7676

7777
if let Some(version_string) = version_string {
78-
let parse_result = Range::parse(&version_string);
78+
let parse_result = Range::parse(version_string);
7979

8080
if let Ok(parse_result) = parse_result {
8181
return Some(VersionFile::Asdf(parse_result));

0 commit comments

Comments
 (0)