d41805704d
rustfmt should only support rewriting a struct in an expression position with alignment (non-default behavior) when there is no rest (with or without a base) and all of the fields are non-shorthand.
42 lines
900 B
Rust
42 lines
900 B
Rust
// rustfmt-struct_field_align_threshold: 30
|
|
// rustfmt-enum_discrim_align_threshold: 30
|
|
// rustfmt-imports_layout: HorizontalVertical
|
|
|
|
#[derive(Default)]
|
|
struct InnerStructA {
|
|
bbbbbbbbb: i32,
|
|
cccccccc: i32,
|
|
}
|
|
|
|
enum SomeEnumNamedD {
|
|
E(InnerStructA),
|
|
F {
|
|
ggggggggggggggggggggggggg: bool,
|
|
h: bool,
|
|
},
|
|
}
|
|
|
|
impl SomeEnumNamedD {
|
|
fn f_variant() -> Self {
|
|
Self::F {
|
|
ggggggggggggggggggggggggg: true,
|
|
h: true,
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk = SomeEnumNamedD::f_variant();
|
|
let something_we_care_about = matches!(
|
|
kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk,
|
|
SomeEnumNamedD::F {
|
|
ggggggggggggggggggggggggg: true,
|
|
..
|
|
}
|
|
);
|
|
|
|
if something_we_care_about {
|
|
println!("Yup it happened");
|
|
}
|
|
}
|