Prefer not accessing the private field of newtype_index types
This commit is contained in:
@@ -34,7 +34,7 @@ impl CrateNum {
|
|||||||
|
|
||||||
impl fmt::Display for CrateNum {
|
impl fmt::Display for CrateNum {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
fmt::Display::fmt(&self.private, f)
|
fmt::Display::fmt(&self.as_u32(), f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ pub struct ExpnId {
|
|||||||
impl fmt::Debug for ExpnId {
|
impl fmt::Debug for ExpnId {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
// Generate crate_::{{expn_}}.
|
// Generate crate_::{{expn_}}.
|
||||||
write!(f, "{:?}::{{{{expn{}}}}}", self.krate, self.local_id.private)
|
write!(f, "{:?}::{{{{expn{}}}}}", self.krate, self.local_id.as_u32())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user