Skip to content

Commit b624b36

Browse files
chore: 🤖 update
1 parent 17597d7 commit b624b36

File tree

4 files changed

+310
-585
lines changed

4 files changed

+310
-585
lines changed

‎crates/oxc_semantic/src/const_enum.rs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//! inlined as literal values.
66
77
use std::collections::HashMap;
8+
use std::fmt;
89
use num_bigint::BigInt;
910
use oxc_span::Span;
1011
use oxc_syntax::symbol::SymbolId;
@@ -37,6 +38,18 @@ impl<'a> PartialEq for ConstEnumMemberValue<'a> {
3738
}
3839
}
3940

41+
impl<'a> fmt::Display for ConstEnumMemberValue<'a> {
42+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
43+
match self {
44+
Self::String(s) => write!(f, "\"{}\"", s),
45+
Self::Number(n) => write!(f, "{}", n),
46+
Self::BigInt(b) => write!(f, "{}n", b),
47+
Self::Boolean(b) => write!(f, "{}", b),
48+
Self::Computed => write!(f, "(computed)"),
49+
}
50+
}
51+
}
52+
4053
/// Information about a const enum member
4154
#[derive(Debug, Clone)]
4255
pub struct ConstEnumMemberInfo<'a> {

0 commit comments

Comments
 (0)