Unnamed repository; edit this file 'description' to name the repository.
vfs: Fix warnings about clippy `str_to_string` rule
Tetsuharu Ohzeki 2024-02-09
parent 81c35d1 · commit cee3c22
-rw-r--r--crates/vfs/src/loader.rs2
-rw-r--r--crates/vfs/src/vfs_path/tests.rs14
2 files changed, 8 insertions, 8 deletions
diff --git a/crates/vfs/src/loader.rs b/crates/vfs/src/loader.rs
index e49849d230..c3d1ff7271 100644
--- a/crates/vfs/src/loader.rs
+++ b/crates/vfs/src/loader.rs
@@ -201,7 +201,7 @@ impl Directories {
/// ```
fn dirs(base: AbsPathBuf, exclude: &[&str]) -> Directories {
let exclude = exclude.iter().map(|it| base.join(it)).collect::<Vec<_>>();
- Directories { extensions: vec!["rs".to_string()], include: vec![base], exclude }
+ Directories { extensions: vec!["rs".to_owned()], include: vec![base], exclude }
}
impl fmt::Debug for Message {
diff --git a/crates/vfs/src/vfs_path/tests.rs b/crates/vfs/src/vfs_path/tests.rs
index 510e021e89..2d89362ee0 100644
--- a/crates/vfs/src/vfs_path/tests.rs
+++ b/crates/vfs/src/vfs_path/tests.rs
@@ -2,29 +2,29 @@ use super::*;
#[test]
fn virtual_path_extensions() {
- assert_eq!(VirtualPath("/".to_string()).name_and_extension(), None);
+ assert_eq!(VirtualPath("/".to_owned()).name_and_extension(), None);
assert_eq!(
- VirtualPath("/directory".to_string()).name_and_extension(),
+ VirtualPath("/directory".to_owned()).name_and_extension(),
Some(("directory", None))
);
assert_eq!(
- VirtualPath("/directory/".to_string()).name_and_extension(),
+ VirtualPath("/directory/".to_owned()).name_and_extension(),
Some(("directory", None))
);
assert_eq!(
- VirtualPath("/directory/file".to_string()).name_and_extension(),
+ VirtualPath("/directory/file".to_owned()).name_and_extension(),
Some(("file", None))
);
assert_eq!(
- VirtualPath("/directory/.file".to_string()).name_and_extension(),
+ VirtualPath("/directory/.file".to_owned()).name_and_extension(),
Some((".file", None))
);
assert_eq!(
- VirtualPath("/directory/.file.rs".to_string()).name_and_extension(),
+ VirtualPath("/directory/.file.rs".to_owned()).name_and_extension(),
Some((".file", Some("rs")))
);
assert_eq!(
- VirtualPath("/directory/file.rs".to_string()).name_and_extension(),
+ VirtualPath("/directory/file.rs".to_owned()).name_and_extension(),
Some(("file", Some("rs")))
);
}