mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
simplify
This commit is contained in:
parent
5471c1ef4b
commit
3c9f2d0e37
1 changed files with 3 additions and 5 deletions
|
@ -455,11 +455,7 @@ impl DefWithBody {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn body_source_map(&self, db: &impl HirDatabase) -> Arc<BodySourceMap> {
|
pub fn body_source_map(&self, db: &impl HirDatabase) -> Arc<BodySourceMap> {
|
||||||
match *self {
|
db.body_with_source_map(*self).1
|
||||||
DefWithBody::Const(ref c) => c.body_source_map(db),
|
|
||||||
DefWithBody::Function(ref f) => f.body_source_map(db),
|
|
||||||
DefWithBody::Static(ref s) => s.body_source_map(db),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Builds a resolver for code inside this item.
|
/// Builds a resolver for code inside this item.
|
||||||
|
@ -610,6 +606,7 @@ impl Const {
|
||||||
db.infer((*self).into())
|
db.infer((*self).into())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
pub(crate) fn body_source_map(&self, db: &impl HirDatabase) -> Arc<BodySourceMap> {
|
pub(crate) fn body_source_map(&self, db: &impl HirDatabase) -> Arc<BodySourceMap> {
|
||||||
db.body_with_source_map((*self).into()).1
|
db.body_with_source_map((*self).into()).1
|
||||||
}
|
}
|
||||||
|
@ -683,6 +680,7 @@ impl Static {
|
||||||
db.infer((*self).into())
|
db.infer((*self).into())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
pub(crate) fn body_source_map(&self, db: &impl HirDatabase) -> Arc<BodySourceMap> {
|
pub(crate) fn body_source_map(&self, db: &impl HirDatabase) -> Arc<BodySourceMap> {
|
||||||
db.body_with_source_map((*self).into()).1
|
db.body_with_source_map((*self).into()).1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue