1 // rustfmt-indent_style: Block
2 // Test expressions with block formatting.
8 let foo = [a_long_name, a_very_lng_name, a_long_name];
44 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 7, 8, 9, 0, 1, 2, 3, 4, 5,
48 let y = [/* comment */ 1, 2 /* post comment */, 3];
52 test123: value_one_two_three_four,
58 let a = WeightedChoice::new(&mut [
59 Weighted { weight: x, item: 0 },
60 Weighted { weight: 1, item: 1 },
61 Weighted { weight: x, item: 2 },
62 Weighted { weight: 1, item: 3 },
66 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
67 yyyyyyyyyyyyyyyyyyyyyyyyyyy,
72 [1 + 3, 4, 5, 6, 7, 7, fncall::<Vec<_>>(3 - 1)]
76 let items = itemize_list(
80 |item| item.span.lo(),
81 |item| item.span.hi(),
86 width: remaining_width,
99 |item| item.span.lo(),
100 |item| item.span.hi(),
105 width: remaining_width,
117 do_not, add, trailing, commas, inside, of, function, like, macros, even, if_they, are, long
120 baz!(one_item_macro_which_is_also_loooooooooooooooooooooooooooooooooooooooooooooooong);
122 let _ = match option {
132 Some(p) => baz!(one_item_macro_as_expression_which_is_also_loooooooooooooooong),
138 .compare_exchandsfasdsdfgsdgsdfgsdfgsdfgsdfgsdfgfsfdsage_weak(
153 if real_total <= limit
154 && !pre_line_comments
155 && !items.into_iter().any(|item| item.as_ref().is_multiline())
157 DefinitiveListTactic::Horizontal
188 let opt = Some(Struct(
199 do_thing(x, |param| {
213 lllllllllong_argument_one,
214 lllllllllong_argument_two,
215 lllllllllllllllllllllllllllllong_argument_three,
222 pparam1param1param1param1param1param1param1param1param1param1aram1,
236 Some(x) => somefunc(anotherfunc(
246 Some(x) => (1, 2, |x| {
251 Some(x) => SomeStruct {
252 f1: long_argument_one,
253 f2: long_argument_two,
254 f3: long_argument_three,
256 None => Ok(SomeStruct {
257 f1: long_argument_one,
258 f2: long_argument_two,
259 f3: long_argument_three,
264 y => func(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx),
267 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
278 /* This comment waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay too long to be kept on the same line */
281 this_last_arg_is_tooooooooooooooooooooooooooooooooo_long_to_be_kept_with_the_pre_comment,
286 let channel: &str = seq.next_element()?
287 .ok_or_else(|| de::Error::invalid_length(2, &self))?;