Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions crates/oxc_ast/src/ast_impl/jsx.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
//! [JSX](https://facebook.github.io/jsx)
use std::fmt;

use std::fmt::{self, Display};

use oxc_span::Atom;

use crate::ast::*;

// 1.2 JSX Elements

impl fmt::Display for JSXIdentifier<'_> {
impl Display for JSXIdentifier<'_> {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.name.fmt(f)
}
}

impl fmt::Display for JSXNamespacedName<'_> {
impl Display for JSXNamespacedName<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}:{}", self.namespace.name, self.name.name)
}
Expand Down Expand Up @@ -91,13 +92,13 @@ impl<'a> JSXMemberExpressionObject<'a> {
}
}

impl fmt::Display for JSXMemberExpression<'_> {
impl Display for JSXMemberExpression<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}.{}", self.object, self.property)
}
}

impl fmt::Display for JSXMemberExpressionObject<'_> {
impl Display for JSXMemberExpressionObject<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::IdentifierReference(id) => id.fmt(f),
Expand All @@ -107,7 +108,7 @@ impl fmt::Display for JSXMemberExpressionObject<'_> {
}
}

impl fmt::Display for JSXElementName<'_> {
impl Display for JSXElementName<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Identifier(ident) => ident.fmt(f),
Expand Down
Loading