Skip to content

Commit da38fe7

Browse files
committed
syntax: tweak Hir's debug impl again
Just always strip Properties. It's so annoying to see it when you really just want to see the syntax.
1 parent eb2eff9 commit da38fe7

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

regex-syntax/src/hir/mod.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,8 @@ impl core::fmt::Display for ErrorKind {
159159
/// look very different. (And potentially not practically readable by a human.)
160160
///
161161
/// An `Hir`'s `fmt::Debug` implementation currently does not use constant
162-
/// stack space. The default implementation will also suppress some details
163-
/// (such as the `Properties` inlined into every `Hir` value to make it less
164-
/// noisy), but using the "[alternate]" format option will show everything.
165-
///
166-
/// [alternate]: https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.alternate
162+
/// stack space. The implementation will also suppress some details (such as
163+
/// the `Properties` inlined into every `Hir` value to make it less noisy).
167164
#[derive(Clone, Eq, PartialEq)]
168165
pub struct Hir {
169166
/// The underlying HIR kind.
@@ -486,14 +483,7 @@ impl HirKind {
486483

487484
impl core::fmt::Debug for Hir {
488485
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
489-
if f.alternate() {
490-
f.debug_struct("Hir")
491-
.field("kind", &self.kind)
492-
.field("props", &self.props)
493-
.finish()
494-
} else {
495-
self.kind.fmt(f)
496-
}
486+
self.kind.fmt(f)
497487
}
498488
}
499489

0 commit comments

Comments
 (0)