It appears that cargo fmt wants to always split the body of a function across 3+ lines, no matter how trivial it is, whereas, I would prefer to have them on the same line as the function signature if it is short.
For example, suppose I define a trait as well as a dummy impl like this
trait Output {
fn new() -> Self;
fn append(&self, u8) -> Self;
fn concat(&self, &Self) -> Self;
}
impl Output for () {
fn new() -> Self {()}
fn append(&self, c: u8) -> Self {()}
fn concat(&self, rhs: &Self) -> Self {()}
}
rustfmt wants to change it to this, which IMO looks pretty silly and takes up unnecessary space, making it harder to read.
trait Output {
fn new() -> Self;
fn append(&self, u8) -> Self;
fn concat(&self, &Self) -> Self;
}
impl Output for () {
fn new() -> Self {
()
}
fn append(&self, c: u8) -> Self {
()
}
fn concat(&self, rhs: &Self) -> Self {
()
}
}