From 1b004dcf8826b0bc73b69b69683e9bf7d996829b Mon Sep 17 00:00:00 2001 From: Song Gao <158983297@qq.com> Date: Tue, 12 Jan 2021 00:16:12 +0800 Subject: Update crates/rust-analyzer/src/handlers.rs Co-authored-by: Jeremy Kolb --- crates/rust-analyzer/src/handlers.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index c1e34c54d..c7b615002 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs @@ -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()?; -- cgit v1.2.3