Skip to content

Commit

Permalink
Auto merge of rust-lang#5184 - matklad:delegate-debug, r=Eh2406
Browse files Browse the repository at this point in the history
Delegate debug implementation for InternedString

Let's make `InternedString` debug implementation the same as for `String` / `str`? It's more concise, which helps when you debug printing other stuff, like `eprintln!("id = {:?}", a_package_id)`.
  • Loading branch information
bors committed Mar 15, 2018
2 parents 805fbeb + 111024c commit 9895340
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cargo/core/interning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ impl Hash for InternedString {

impl fmt::Debug for InternedString {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "InternedString {{ {} }}", self.to_inner())
fmt::Debug::fmt(self.to_inner(), f)
}
}

impl fmt::Display for InternedString {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.to_inner())
fmt::Display::fmt(self.to_inner(), f)
}
}

Expand Down

0 comments on commit 9895340

Please sign in to comment.