rust/tests/target/space-not-after-type-annotation-colon.rs
est31 aa4cd311bb Add config options for spaces around the colon in struct literal fields
In Rust, colons are used for three purposes:

* Type annotations, including type ascription
* Trait bounds
* Struct literal fields

This commit adds options for the last missing of the three purposes,
struct literal fields.
2017-06-06 03:50:58 +02:00

14 lines
273 B
Rust

// rustfmt-space_before_type_annotation: true
// rustfmt-space_after_type_annotation_colon: false
static staticVar :i32 = 42;
const constVar :i32 = 42;
fn foo(paramVar :i32) {
let localVar :i32 = 42;
}
struct S {
fieldVar :i32,
}
fn f() {
S { fieldVar: 42 }
}