Hey, running cargo fmt creates output thats different to running rustfmt.
From my understanding, cargo fmt is just a wrapper around rustfmt?
What can i do to make them behave the same?
In this example I don't have a rustfmt.toml and the Cargo.toml has the default configuration.
cargo fmt:
mod a;
use crate::a::A;
use crate::a::b::B;
fn main() {
std::thread::spawn(move || {
loop {
println!("Hello world {:?} {:?}", A {}, B {});
}
});
}
rustfmt src/main.rs:
mod a;
use crate::a::b::B;
use crate::a::A;
fn main() {
std::thread::spawn(move || loop {
println!("Hello world {:?} {:?}", A {}, B {});
});
}
rustfmt --version: rustfmt 1.8.0-stable (4d91de4e48 2025-02-17)
cargo fmt --version: rustfmt 1.8.0-stable (4d91de4e48 2025-02-17)