summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/expr-overflow-delimited.rs
blob: b00e81fcd5a500df3145c87fe5ea34c110834ca7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// rustfmt-overflow_delimited_expr: true

fn combine_blocklike() {
    do_thing(|param| {
        action();
        foo(param)
    });

    do_thing(x, |param| {
        action();
        foo(param)
    });

    do_thing(
        x,
        // I'll be discussing the `action` with your para(m)legal counsel
        |param| {
            action();
            foo(param)
        },
    );

    do_thing(Bar {
        x: value,
        y: value2,
    });

    do_thing(x, Bar {
        x: value,
        y: value2,
    });

    do_thing(
        x,
        // Let me tell you about that one time at the `Bar`
        Bar {
            x: value,
            y: value2,
        },
    );

    do_thing(&[
        value_with_longer_name,
        value2_with_longer_name,
        value3_with_longer_name,
        value4_with_longer_name,
    ]);

    do_thing(x, &[
        value_with_longer_name,
        value2_with_longer_name,
        value3_with_longer_name,
        value4_with_longer_name,
    ]);

    do_thing(
        x,
        // Just admit it; my list is longer than can be folded on to one line
        &[
            value_with_longer_name,
            value2_with_longer_name,
            value3_with_longer_name,
            value4_with_longer_name,
        ],
    );

    do_thing(vec![
        value_with_longer_name,
        value2_with_longer_name,
        value3_with_longer_name,
        value4_with_longer_name,
    ]);

    do_thing(x, vec![
        value_with_longer_name,
        value2_with_longer_name,
        value3_with_longer_name,
        value4_with_longer_name,
    ]);

    do_thing(
        x,
        // Just admit it; my list is longer than can be folded on to one line
        vec![
            value_with_longer_name,
            value2_with_longer_name,
            value3_with_longer_name,
            value4_with_longer_name,
        ],
    );

    do_thing(
        x,
        (1, 2, 3, |param| {
            action();
            foo(param)
        }),
    );
}

fn combine_struct_sample() {
    let identity = verify(&ctx, VerifyLogin {
        type_: LoginType::Username,
        username: args.username.clone(),
        password: Some(args.password.clone()),
        domain: None,
    })?;
}

fn combine_macro_sample() {
    rocket::ignite()
        .mount("/", routes![
            http::auth::login,
            http::auth::logout,
            http::cors::options,
            http::action::dance,
            http::action::sleep,
        ])
        .launch();
}