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

fix(rome_formatter): write! dropped while still borrowed #3067

Merged
merged 1 commit into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions crates/rome_formatter/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ macro_rules! format_args {
#[macro_export]
macro_rules! write {
($dst:expr, [$($arg:expr),+ $(,)?]) => {{
$dst.write_fmt($crate::format_args!($($arg),+))
let result = $dst.write_fmt($crate::format_args!($($arg),+));
result
}}
}

Expand Down Expand Up @@ -103,7 +104,8 @@ macro_rules! dbg_write {
);
count += 1;
});
inspect.write_fmt($crate::format_args!($($arg),+))
let result = inspect.write_fmt($crate::format_args!($($arg),+));
result
}}
}

Expand Down
3 changes: 1 addition & 2 deletions crates/rome_js_formatter/src/utils/binary_like_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,7 @@ impl FlattenedBinaryExpressionPart {
FlattenedBinaryExpressionPart::Right { parent } => {
let right = JsAnyBinaryLikeLeftExpression::JsAnyExpression(parent.right()?);

write!(f, [format_sub_expression(parent.operator()?, &right)])?;
Ok(())
write!(f, [format_sub_expression(parent.operator()?, &right)])
}
FlattenedBinaryExpressionPart::Left { expression } => {
write!(f, [expression])
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载