From 497e9da43361daabfd0cf3653181be86b4163bce Mon Sep 17 00:00:00 2001 From: Song Gao <158983297@qq.com> Date: Tue, 12 Jan 2021 00:15:56 +0800 Subject: Update crates/rust-analyzer/src/handlers.rs Co-authored-by: Jeremy Kolb --- crates/rust-analyzer/src/handlers.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 17f67d4b7..c1e34c54d 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs @@ -450,10 +450,8 @@ pub(crate) fn handle_will_rename_files( imite_new_file_name.to_string(), )) } else { - let old_name = from_path.file_stem()?; - let old_name = old_name.to_str()?; - let new_name = to_path.file_stem()?; - let new_name = new_name.to_str()?; + let old_name = from_path.file_stem()?.to_str()?; + let new_name = to_path.file_stem()?.to_str()?; if old_name != "mod" && new_name != "mod" { Some((snap.url_to_file_id(&from).ok()?, new_name.to_string())) } else { -- cgit v1.2.3