Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Simplify setter formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Jun 4, 2022
1 parent c6183b3 commit 1196545
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::prelude::*;
use crate::utils::FormatWithSemicolon;
use crate::FormatNodeFields;
use rome_formatter::write;
use rome_formatter::{format_args, write};
use rome_js_syntax::{TsSetterSignatureClassMember, TsSetterSignatureClassMemberFields};

impl FormatNodeFields<TsSetterSignatureClassMember>
Expand All @@ -18,10 +18,10 @@ impl FormatNodeFields<TsSetterSignatureClassMember>
semicolon_token,
} = node.as_fields();

let setter = format_with(|f| {
write!(
f,
[
write!(
f,
[FormatWithSemicolon::new(
&format_args!(
modifiers.format(),
space_token(),
set_token.format(),
Expand All @@ -30,13 +30,9 @@ impl FormatNodeFields<TsSetterSignatureClassMember>
l_paren_token.format(),
parameter.format(),
r_paren_token.format(),
]
)
});

write!(
f,
[FormatWithSemicolon::new(&setter, semicolon_token.as_ref())]
),
semicolon_token.as_ref()
)]
)
}
}

0 comments on commit 1196545

Please sign in to comment.