1 // rustfmt-indent_style: Block
2 // Test expressions with block formatting.
8 let foo = [a_long_name, a_very_lng_name, a_long_name];
81 let y = [/* comment */ 1, 2 /* post comment */, 3];
85 test123: value_one_two_three_four,
91 let a = WeightedChoice::new(&mut [
92 Weighted { weight: x, item: 0 },
93 Weighted { weight: 1, item: 1 },
94 Weighted { weight: x, item: 2 },
95 Weighted { weight: 1, item: 3 },
99 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
100 yyyyyyyyyyyyyyyyyyyyyyyyyyy,
105 [1 + 3, 4, 5, 6, 7, 7, fncall::<Vec<_>>(3 - 1)]
108 fn function_calls() {
109 let items = itemize_list(
113 |item| item.span.lo(),
114 |item| item.span.hi(),
119 width: remaining_width,
132 |item| item.span.lo(),
133 |item| item.span.hi(),
138 width: remaining_width,
165 baz!(one_item_macro_which_is_also_loooooooooooooooooooooooooooooooooooooooooooooooong);
167 let _ = match option {
177 Some(p) => baz!(one_item_macro_as_expression_which_is_also_loooooooooooooooong),
183 .compare_exchandsfasdsdfgsdgsdfgsdfgsdfgsdfgsdfgfsfdsage_weak(
198 if real_total <= limit && !pre_line_comments
199 && !items.into_iter().any(|item| item.as_ref().is_multiline())
201 DefinitiveListTactic::Horizontal
232 let opt = Some(Struct(
243 do_thing(x, |param| {
257 lllllllllong_argument_one,
258 lllllllllong_argument_two,
259 lllllllllllllllllllllllllllllong_argument_three,
266 pparam1param1param1param1param1param1param1param1param1param1aram1,
280 Some(x) => somefunc(anotherfunc(
290 Some(x) => (1, 2, |x| {
295 Some(x) => SomeStruct {
296 f1: long_argument_one,
297 f2: long_argument_two,
298 f3: long_argument_three,
300 None => Ok(SomeStruct {
301 f1: long_argument_one,
302 f2: long_argument_two,
303 f3: long_argument_three,
308 y => func(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx),
311 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
322 /* This comment waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay too long to be kept on the same line */
325 this_last_arg_is_tooooooooooooooooooooooooooooooooo_long_to_be_kept_with_the_pre_comment,
330 let channel: &str = seq.next_element()?
331 .ok_or_else(|| de::Error::invalid_length(2, &self))?;