Add inline.

This commit is contained in:
Camille GILLOT 2021-12-10 13:23:48 +01:00
parent d9c6e70c57
commit 8617ff0f0b
1 changed files with 2 additions and 0 deletions

View File

@ -19,11 +19,13 @@ pub struct HirId {
}
impl HirId {
#[inline]
pub fn expect_owner(self) -> LocalDefId {
assert_eq!(self.local_id.index(), 0);
self.owner
}
#[inline]
pub fn as_owner(self) -> Option<LocalDefId> {
if self.local_id.index() == 0 { Some(self.owner) } else { None }
}