Skip to content

Commit cdba1c7

Browse files
committed
refactor: use RawValue::from_string for potential perf win
1 parent 9a6a945 commit cdba1c7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/cargo/core/compiler/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,8 +1836,7 @@ fn on_stderr_line_inner(
18361836
{
18371837
error.rendered = anstream::adapter::strip_str(&error.rendered).to_string();
18381838
let new_line = serde_json::to_string(&error)?;
1839-
let new_msg: Box<serde_json::value::RawValue> = serde_json::from_str(&new_line)?;
1840-
compiler_message = new_msg;
1839+
compiler_message = serde_json::value::RawValue::from_string(new_line)?;
18411840
}
18421841
}
18431842

0 commit comments

Comments
 (0)