2015-11-09 20:03:01 +01:00
|
|
|
// rustfmt-wrap_comments: true
|
2015-09-19 09:00:53 +02:00
|
|
|
// rustfmt-hard_tabs: true
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = Bar;
|
|
|
|
|
|
|
|
let y = Foo { a: x };
|
|
|
|
|
|
|
|
Foo {
|
|
|
|
a: foo(), // comment
|
|
|
|
// comment
|
|
|
|
b: bar(),
|
|
|
|
..something
|
|
|
|
};
|
|
|
|
|
|
|
|
fn foo(a: i32,
|
|
|
|
a: i32,
|
|
|
|
a: i32,
|
|
|
|
a: i32,
|
|
|
|
a: i32,
|
|
|
|
a: i32,
|
|
|
|
a: i32,
|
|
|
|
a: i32,
|
|
|
|
a: i32,
|
|
|
|
a: i32,
|
|
|
|
a: i32) {
|
|
|
|
}
|
|
|
|
|
|
|
|
let str = "AAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAA\
|
|
|
|
AAAAAAAAAAAAaAa";
|
|
|
|
|
2015-10-17 15:56:53 +02:00
|
|
|
if let (some_very_large,
|
|
|
|
tuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuple) = 1 + 2 + 3 {
|
2015-09-19 09:00:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if cond() {
|
|
|
|
something();
|
|
|
|
} else if different_cond() {
|
|
|
|
something_else();
|
|
|
|
} else {
|
|
|
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
|
|
|
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe /* very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
|
|
|
|
* comment */ {
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe /* So this is a very long comment.
|
|
|
|
* Multi-line, too.
|
|
|
|
* Will it still format correctly? */ {
|
|
|
|
}
|
|
|
|
|
2015-10-14 19:41:29 +02:00
|
|
|
let chain = funktion_kall()
|
|
|
|
.go_to_next_line_with_tab()
|
|
|
|
.go_to_next_line_with_tab()
|
|
|
|
.go_to_next_line_with_tab();
|
|
|
|
|
2015-09-19 09:00:53 +02:00
|
|
|
let z = [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
|
|
|
|
yyyyyyyyyyyyyyyyyyyyyyyyyyy,
|
|
|
|
zzzzzzzzzzzzzzzzzz,
|
|
|
|
q];
|
|
|
|
|
|
|
|
fn generic<T>(arg: T) -> &SomeType
|
|
|
|
where T: Fn(// First arg
|
|
|
|
A,
|
|
|
|
// Second argument
|
|
|
|
B,
|
|
|
|
C,
|
|
|
|
D,
|
|
|
|
// pre comment
|
2015-11-22 14:48:30 +01:00
|
|
|
E /* last comment */)
|
|
|
|
-> &SomeType
|
2015-09-19 09:00:53 +02:00
|
|
|
{
|
|
|
|
arg(a, b, c, d, e)
|
|
|
|
}
|
|
|
|
|
|
|
|
loong_func().quux(move || {
|
|
|
|
if true {
|
|
|
|
1
|
|
|
|
} else {
|
|
|
|
2
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-10-08 23:07:19 +02:00
|
|
|
fffffffffffffffffffffffffffffffffff(a, {
|
|
|
|
SCRIPT_TASK_ROOT.with(|root| {
|
|
|
|
*root.borrow_mut() = Some(&script_task);
|
|
|
|
});
|
|
|
|
});
|
2015-09-19 09:00:53 +02:00
|
|
|
a.b
|
|
|
|
.c
|
|
|
|
.d();
|
|
|
|
|
|
|
|
x().y(|| {
|
|
|
|
match cond() {
|
|
|
|
true => (),
|
|
|
|
false => (),
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|