rust/tests/target/chains.rs

47 lines
1.6 KiB
Rust
Raw Normal View History

2015-09-09 23:13:37 +02:00
// Test chain formatting.
fn main() {
let a = b.c.d.1.foo(|x| x + 1);
bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddd();
bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc
2015-09-09 23:14:54 +02:00
.ddddddddddddddddddddddddddd
.eeeeeeee();
2015-09-09 23:13:37 +02:00
x().y(|| {
match cond() {
true => (),
false => (),
}
});
loong_func()
.quux(move || {
if true {
1
} else {
2
}
});
2015-09-09 23:14:09 +02:00
fffffffffffffffffffffffffffffffffff(a,
{
SCRIPT_TASK_ROOT.with(|root| {
// Another case of write_list failing us.
*root.borrow_mut() = Some(&script_task);
});
});
2015-09-09 23:13:37 +02:00
let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum = xxxxxxx.map(|x| x + 5)
2015-09-09 23:14:54 +02:00
.map(|x| x / 2)
.fold(0,
|acc, x| acc + x);
aaaaaaaaaaaaaaaa.map(|x| {
x += 1;
x
})
.filter(some_mod::some_filter)
2015-09-09 23:13:37 +02:00
}