Sourcify some things

If we want to support macros properly, we need to get rid of those
FileIds everywhere...
This commit is contained in:
Aleksey Kladov 2019-11-15 23:24:56 +03:00
parent 1889b3c7b5
commit 4c90b7e2ec
6 changed files with 22 additions and 21 deletions

View file

@ -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) }
}