1
Fork 0

Prefer not accessing the private field of newtype_index types

This commit is contained in:
Oli Scherer 2022-11-03 08:12:19 +00:00
parent b5554722ff
commit 2a94a2d385
2 changed files with 2 additions and 2 deletions

View file

@ -34,7 +34,7 @@ impl CrateNum {
impl fmt::Display for CrateNum {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(&self.private, f)
fmt::Display::fmt(&self.as_u32(), f)
}
}

View file

@ -76,7 +76,7 @@ pub struct ExpnId {
impl fmt::Debug for ExpnId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// Generate crate_::{{expn_}}.
write!(f, "{:?}::{{{{expn{}}}}}", self.krate, self.local_id.private)
write!(f, "{:?}::{{{{expn{}}}}}", self.krate, self.local_id.as_u32())
}
}