Skip to content

Commit

Permalink
Clarify use of format_args in Debug for Literal
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed May 15, 2020
1 parent 4c4b4c4 commit bea2c59
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libproc_macro/bridge/client.rs
Expand Up @@ -205,6 +205,7 @@ impl Clone for Literal {
impl fmt::Debug for Literal {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Literal")
// format the kind without quotes, as in `kind: Float`
.field("kind", &format_args!("{}", &self.debug_kind()))
.field("symbol", &self.symbol())
// format `Some("...")` on one line even in {:#?} mode
Expand Down

0 comments on commit bea2c59

Please sign in to comment.