Closed
Description
It seems that rustfmt doesn't wrap long slice pattern lines.
Input
enum Foo {
IAmALongVariantNameIJustKeepGoingOn { a: usize, b: usize },
}
fn main() {
let foos = vec![Foo::IAmALongVariantNameIJustKeepGoingOn { a: 0, b: 0 }];
match foos.as_slice() {
[
Foo::IAmALongVariantNameIJustKeepGoingOn { a: 0, b: 0 },
Foo::IAmALongVariantNameIJustKeepGoingOn { a: 0, b: 0 },
Foo::IAmALongVariantNameIJustKeepGoingOn { a: 0, b: 0 },
] => {}
_ => {}
}
}
Output
enum Foo {
IAmALongVariantNameIJustKeepGoingOn { a: usize, b: usize },
}
fn main() {
let foos = vec![Foo::IAmALongVariantNameIJustKeepGoingOn { a: 0, b: 0 }];
match foos.as_slice() {
[Foo::IAmALongVariantNameIJustKeepGoingOn { a: 0, b: 0 }, Foo::IAmALongVariantNameIJustKeepGoingOn { a: 0, b: 0 }, Foo::IAmALongVariantNameIJustKeepGoingOn { a: 0, b: 0 }] =>
{}
_ => {}
}
}
Expected output
enum Foo {
IAmALongVariantNameIJustKeepGoingOn { a: usize, b: usize },
}
fn main() {
let foos = vec![Foo::IAmALongVariantNameIJustKeepGoingOn { a: 0, b: 0 }];
match foos.as_slice() {
[
Foo::IAmALongVariantNameIJustKeepGoingOn { a: 0, b: 0 },
Foo::IAmALongVariantNameIJustKeepGoingOn { a: 0, b: 0 },
Foo::IAmALongVariantNameIJustKeepGoingOn { a: 0, b: 0 },
] => {}
_ => {}
}
}
Meta