mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Sourcify some things
If we want to support macros properly, we need to get rid of those FileIds everywhere...
This commit is contained in:
parent
1889b3c7b5
commit
4c90b7e2ec
6 changed files with 22 additions and 21 deletions
|
@ -230,6 +230,10 @@ pub struct Source<T> {
|
|||
}
|
||||
|
||||
impl<T> Source<T> {
|
||||
pub fn new(file_id: HirFileId, ast: T) -> Source<T> {
|
||||
Source { file_id, ast }
|
||||
}
|
||||
|
||||
pub fn map<F: FnOnce(T) -> U, U>(self, f: F) -> Source<U> {
|
||||
Source { file_id: self.file_id, ast: f(self.ast) }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue