diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-15 20:25:53 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-15 20:25:53 +0000 |
commit | 920848940ae7b79b1655ac48a9e2c1694b9e06c8 (patch) | |
tree | cd0d39cd13ae0a9ee7299db575bea1a854cc0102 /crates/ra_hir_expand | |
parent | 86469d4195e7aeb93ae420d0c073593bfccc97f0 (diff) | |
parent | 4c90b7e2ecd03e739a3c92bbe5afd4c90fe2812d (diff) |
Merge #2266
2266: Sourcify some things r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_expand')
-rw-r--r-- | crates/ra_hir_expand/src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs index 930789b0f..437d73e94 100644 --- a/crates/ra_hir_expand/src/lib.rs +++ b/crates/ra_hir_expand/src/lib.rs | |||
@@ -230,6 +230,10 @@ pub struct Source<T> { | |||
230 | } | 230 | } |
231 | 231 | ||
232 | impl<T> Source<T> { | 232 | impl<T> Source<T> { |
233 | pub fn new(file_id: HirFileId, ast: T) -> Source<T> { | ||
234 | Source { file_id, ast } | ||
235 | } | ||
236 | |||
233 | pub fn map<F: FnOnce(T) -> U, U>(self, f: F) -> Source<U> { | 237 | pub fn map<F: FnOnce(T) -> U, U>(self, f: F) -> Source<U> { |
234 | Source { file_id: self.file_id, ast: f(self.ast) } | 238 | Source { file_id: self.file_id, ast: f(self.ast) } |
235 | } | 239 | } |