Skip to content

Commit a4f1884

Browse files
committed
升级 Rust Edition
1 parent d31bde2 commit a4f1884

File tree

3 files changed

+38
-35
lines changed

3 files changed

+38
-35
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "torrent-tidy"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[workspace]
77
# 指定解析器版本

benches/split.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ fn split_filename(filename: &str) -> (String, String) {
88
Regex::new(r"^(.*?)\.(tar\.gz|tar\.xz|tar\.bz2|cpio\.gz|cpio\.bz2|(?:7z|rar|zip)\.\d{3}|[^.]+)$").unwrap()
99
});
1010

11-
if let Some(caps) = RE.captures(filename) {
12-
(caps.get(1).unwrap().as_str().to_string(), caps.get(2).unwrap().as_str().to_string())
13-
} else {
14-
(filename.to_string(), String::new()) // 无扩展名的情况
11+
match RE.captures(filename) {
12+
Some(caps) => {
13+
(caps.get(1).unwrap().as_str().to_string(), caps.get(2).unwrap().as_str().to_string())
14+
}
15+
_ => {
16+
(filename.to_string(), String::new()) // 无扩展名的情况
17+
}
1518
}
1619
}
1720

0 commit comments

Comments
 (0)