Skip to content

Commit

Permalink
align debug implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Sep 2, 2023
1 parent 621a445 commit fc0d6aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/ruff_formatter/src/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl<Context> Format<Context> for Token {

impl std::fmt::Debug for Token {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::write!(f, "StaticToken({})", self.text)
std::write!(f, "Token({})", self.text)
}
}

Expand Down Expand Up @@ -364,7 +364,7 @@ impl<Context> Format<Context> for Text<'_> {

impl std::fmt::Debug for Text<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::write!(f, "DynamicToken({})", self.text)
std::write!(f, "Text({})", self.text)
}
}

Expand Down Expand Up @@ -2244,15 +2244,15 @@ where
///
/// Formatting the same value twice results in a panic.
///
/// ```panics
/// ```should_panic
/// use ruff_formatter::prelude::*;
/// use ruff_formatter::{SimpleFormatContext, format, write, Buffer};
/// use ruff_text_size::TextSize;
///
/// let mut count = 0;
///
/// let value = format_once(|f| {
/// write!(f, [dynamic_token(&std::format!("Formatted {count}."), TextSize::default())])
/// write!(f, [text(&std::format!("Formatted {count}."), None)])
/// });
///
/// format!(SimpleFormatContext::default(), [value]).expect("Formatting once works fine");
Expand Down

0 comments on commit fc0d6aa

Please sign in to comment.