Rustfmt ... is there a way to disable single splitting a line at =

Is there a setting in rustfmt to disable single splitting a line at = ?.

For example say I have:

let a = c && d && e && f;

I would like it to stay as is (if it fits) or if it's too long then I would like each && group on own line. Something like:

let a = 
    c && 
    d && 
    e &&
    f;

What I dislike and would like some way to disable is a formatting result that splits only at the equal sign:

// Don't want this
let a = 
    c && d && e && f;

Is that possible, I have a rustfmt.toml, but haven't managed to find the right setting for this.

(I've just updated this post, original title had mental typo == instead of =)

Thanks,
Jesse

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.