You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[macro_use]externcrate serde_json;fnmain(){let l = vec![1,2,3];let ret:Vec<_> = l
.into_iter().map(|i| {json!({"value": i,"value2": i *2,})}).collect();}
After running cargo fmt, it becomes
#[macro_use]externcrate serde_json;fnmain(){let l = vec![1,2,3];let ret:Vec<_> = l.into_iter().map(|i| json!({"value": i })).collect();}
As it shows, the second property inside json! was removed.
Expected
cargo fmt/rustfmt should not remove the second property inside json! macro.
Simplified example
main.rs
After running
cargo fmt
, it becomesAs it shows, the second property inside
json!
was removed.Expected
cargo fmt
/rustfmt
should not remove the second property insidejson!
macro.Extra Info
Let me know if extra info is needed. Thanks.
The text was updated successfully, but these errors were encountered: