]> git.lizzy.rs Git - rust.git/commitdiff
Update crates/rust-analyzer/src/handlers.rs
authorSong Gao <158983297@qq.com>
Mon, 11 Jan 2021 16:16:12 +0000 (00:16 +0800)
committerGitHub <noreply@github.com>
Mon, 11 Jan 2021 16:16:12 +0000 (00:16 +0800)
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
crates/rust-analyzer/src/handlers.rs

index c1e34c54d1d1f78061b928ccb6f65c18482cbde2..c7b6150028b0b571ab0312a67a55b40a5e0fd817 100644 (file)
@@ -437,9 +437,7 @@ pub(crate) fn handle_will_rename_files(
                         // imitate change the older_folder/mod.rs to older_folder/new_folder.rs
 
                         // add '/' to end of url -- from `file://path/to/folder` to `file://path/to/folder/`
-                        let old_folder_name = from_path.file_stem()?;
-                        let old_folder_name = old_folder_name.to_str()?;
-                        let mut old_folder_name = old_folder_name.to_string();
+                        let mut old_folder_name = from_path.file_stem()?.to_str()?.to_string();
                         old_folder_name.push('/');
                         let from_with_trailing_slash = from.join(&old_folder_name).ok()?;