mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 07:04:22 +00:00
vfs: Fix warnings about clippy str_to_string
rule
This commit is contained in:
parent
81c35d1f56
commit
cee3c22ae8
2 changed files with 8 additions and 8 deletions
|
@ -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 {
|
||||
|
|
|
@ -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")))
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue