]> git.lizzy.rs Git - rust.git/blob - tests/target/fn-single-line.rs
Merge pull request #681 from rust-lang-nursery/comment-style
[rust.git] / tests / target / fn-single-line.rs
1 // rustfmt-fn_single_line: true
2 // Test single-line functions.
3
4 fn foo_expr() { 1 }
5
6 fn foo_stmt() { foo(); }
7
8 fn foo_decl_local() { let z = 5; }
9
10 fn foo_decl_item(x: &mut i32) { x = 3; }
11
12 fn empty() {}
13
14 fn foo_return() -> String { "yay" }
15
16 fn foo_where() -> T
17     where T: Sync
18 {
19     let x = 2;
20 }
21
22 fn fooblock() {
23     {
24         "inner-block"
25     }
26 }
27
28 fn fooblock2(x: i32) {
29     let z = match x {
30         _ => 2,
31     };
32 }
33
34 fn comment() {
35     // this is a test comment
36     1
37 }
38
39 fn comment2() {
40     // multi-line comment
41     let z = 2;
42     1
43 }
44
45 fn only_comment() {
46     // Keep this here
47 }
48
49 fn aaaaaaaaaaaaaaaaa_looooooooooooooooooooooong_name() {
50     let z = "aaaaaaawwwwwwwwwwwwwwwwwwwwwwwwwwww";
51 }
52
53 fn lots_of_space() { 1 }
54
55 fn mac() -> Vec<i32> { vec![] }
56
57 trait CoolTypes {
58     fn dummy(&self) {}
59 }
60
61 trait CoolerTypes {
62     fn dummy(&self) {}
63 }