-
Notifications
You must be signed in to change notification settings - Fork 909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Format fails silently with long string #5517
Comments
Try setting |
I don't believe the claim that we fail to format the rest of the document is correct. Can you please elaborate with a code snippet that shows that behavior. Invoking rustfmt from the command line with the following input show that we still format things further on in the document even though we don't format the struct. input struct SomeStruct {
inner: String,
}
impl SomeStruct {
pub fn new() -> SomeStruct {
SomeStruct
{ //<-intentional Format Mistake
//fails silently
inner: "Some long text Some long text Some long text Some long text Some long text Some long text Some long text".into()
//works
// inner: "Short text".into()
}
}
}
fn main() {
println!("hello world!");
} output struct SomeStruct {
inner: String,
}
impl SomeStruct {
pub fn new() -> SomeStruct {
SomeStruct
{ //<-intentional Format Mistake
//fails silently
inner: "Some long text Some long text Some long text Some long text Some long text Some long text Some long text".into()
//works
// inner: "Short text".into()
}
}
}
fn main() {
println!("hello world!");
} |
I'm sorry you are correct...it does format the rest of the document outside of the struct in question, I hadn't explored it further than what i show in the comments. error_on_unformatted=true didn't make a difference for me |
Got it. Can you try setting both |
You nailed it..sorry i searched for other issues but didn't come across that or the ones it references...I'll close this then since it's a duplicate..thank you for your help! |
No worries! It never hurts to reach out! Please let us know if anything else comes up😁 |
Will do, Thanks! |
Hello,
When a file has a long line of text it fails silently without formatting the rest of the document
link with code in the playground...if you comment out the long inner line and use the shorter one..fmt works
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=2d15a242e19893857057fb430005361f
Awesome project thank you very much
The text was updated successfully, but these errors were encountered: