Add inline.

This commit is contained in:
Camille GILLOT 2021-12-10 13:23:48 +01:00
parent d9c6e70c57
commit 8617ff0f0b

View File

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