Closed musjj closed 1 month ago
Some method calls won't format if there's a long literal string in it. For example, an .expect() with a long message:
.expect()
fn foo() { let _: i32 = "42".parse::<i32>() .expect("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); }
rustfmt will skip formatting in this entire line. You can test it in in the playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=135ec08b2266e6e642bb1603f7592100. If you shorten the string by a single char, it will get formatted correctly.
rustfmt
Tested with rustfmt 1.8.0-nightly (eb4e234674 2024-10-09).
rustfmt 1.8.0-nightly (eb4e234674 2024-10-09)
Duplicate of https://github.com/rust-lang/rustfmt/issues/3863
Some method calls won't format if there's a long literal string in it. For example, an
.expect()
with a long message:rustfmt
will skip formatting in this entire line. You can test it in in the playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=135ec08b2266e6e642bb1603f7592100. If you shorten the string by a single char, it will get formatted correctly.Tested with
rustfmt 1.8.0-nightly (eb4e234674 2024-10-09)
.