Use Path::file_stem instead

This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-03-04 20:07:39 +00:00
parent b4936133bb
commit 9bebbf14c5
No known key found for this signature in database
GPG Key ID: 95DDEBD74A1DC2C0

View File

@ -84,9 +84,7 @@ pub fn check(tests_path: impl AsRef<Path>, bad: &mut bool) {
}
});
let Some((test_name, _)) =
test.file_name().map(OsStr::to_str).flatten().map(|n| n.split_once('.')).flatten()
else {
let Some(test_name) = test.file_stem().map(OsStr::to_str).flatten() else {
continue;
};