Apply suggestions from code review
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
This commit is contained in:
parent
659b0a2fd9
commit
77c300285c
@ -671,7 +671,7 @@ pub struct Crate<'hir> {
|
||||
pub attrs: BTreeMap<HirId, &'hir [Attribute]>,
|
||||
}
|
||||
|
||||
impl<'hir> Crate<'hir> {
|
||||
impl Crate<'hir> {
|
||||
pub fn module(&self) -> &'hir Mod<'hir> {
|
||||
if let Some(OwnerNode::Crate(m)) = self.owners[CRATE_DEF_ID] { m } else { panic!() }
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ pub fn krate(&self) -> &'hir Crate<'hir> {
|
||||
pub fn root_module(&self) -> &'hir Mod<'hir> {
|
||||
match self.tcx.hir_owner(CRATE_DEF_ID).map(|o| o.node) {
|
||||
Some(OwnerNode::Crate(item)) => item,
|
||||
_ => panic!(),
|
||||
_ => bug!(),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user