Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/load-cargo/src/lib.rs')
| -rw-r--r-- | crates/load-cargo/src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/load-cargo/src/lib.rs b/crates/load-cargo/src/lib.rs index 4ffc8383b6..e01ce0b129 100644 --- a/crates/load-cargo/src/lib.rs +++ b/crates/load-cargo/src/lib.rs @@ -540,7 +540,7 @@ impl ProcMacroExpander for Expander { current_dir: String, ) -> Result<tt::TopSubtree, ProcMacroExpansionError> { let mut cb = |req| match req { - SubRequest::LocalFileName { file_id } => { + SubRequest::LocalFilePath { file_id } => { let file = FileId::from_raw(file_id); let source_root_id = db.file_source_root(file).source_root_id(db); let source_root = db.source_root(source_root_id).source_root(db); @@ -548,9 +548,9 @@ impl ProcMacroExpander for Expander { let name = source_root .path_for_file(&file) .and_then(|path| path.as_path()) - .and_then(|path| path.file_name().map(|filename| filename.to_owned())); + .map(|path| path.to_string()); - Ok(SubResponse::LocalFileNameResult { name }) + Ok(SubResponse::LocalFilePathResult { name }) } SubRequest::SourceText { file_id, start, end } => { let file = FileId::from_raw(file_id); @@ -558,7 +558,7 @@ impl ProcMacroExpander for Expander { let slice = text.get(start as usize..end as usize).map(ToOwned::to_owned); Ok(SubResponse::SourceTextResult { text: slice }) } - SubRequest::FileName { file_id } => { + SubRequest::FilePath { file_id } => { let file = FileId::from_raw(file_id); let source_root_id = db.file_source_root(file).source_root_id(db); let source_root = db.source_root(source_root_id).source_root(db); @@ -566,10 +566,10 @@ impl ProcMacroExpander for Expander { let name = source_root .path_for_file(&file) .and_then(|path| path.as_path()) - .and_then(|path| path.file_name().map(|filename| filename.to_owned())) + .map(|path| path.to_string()) .unwrap_or_default(); - Ok(SubResponse::FileNameResult { name }) + Ok(SubResponse::FilePathResult { name }) } }; match self.0.expand( |