fix(rome_formatter): `write!` dropped while still borrowed
MODIFY
crates/rome_formatter/src/macros.rs
crates/rome_formatter/src/macros.rs
@@ -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
}}
}
@@ -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
}}
}

MODIFY
crates/rome_js_formatter/src/utils/binary_like_expression.rs
crates/rome_js_formatter/src/utils/binary_like_expression.rs
@@ -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])

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