Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(es/codegen): Accept &impl Node instead of impl Node #8969

Merged
merged 2 commits into from
May 23, 2024
Merged
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions crates/swc_ecma_codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub type Result = io::Result<()>;
pub fn to_code_default(
cm: Lrc<SourceMap>,
comments: Option<&dyn Comments>,
node: impl Node,
node: &impl Node,
) -> String {
let mut buf = vec![];
{
Expand All @@ -59,12 +59,12 @@ pub fn to_code_default(
}

/// Generate a code from a syntax node using default options.
pub fn to_code_with_comments(comments: Option<&dyn Comments>, node: impl Node) -> String {
pub fn to_code_with_comments(comments: Option<&dyn Comments>, node: &impl Node) -> String {
to_code_default(Default::default(), comments, node)
}

/// Generate a code from a syntax node using default options.
pub fn to_code(node: impl Node) -> String {
pub fn to_code(node: &impl Node) -> String {
to_code_with_comments(None, node)
}

Expand Down
Loading