1 // Test expressions with block formatting.
7 let foo = [a_long_name, a_very_lng_name, a_long_name];
43 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,
47 let y = [/* comment */ 1, 2 /* post comment */, 3];
51 test123: value_one_two_three_four,
57 let a = WeightedChoice::new(&mut [
58 Weighted { weight: x, item: 0 },
59 Weighted { weight: 1, item: 1 },
60 Weighted { weight: x, item: 2 },
61 Weighted { weight: 1, item: 3 },
65 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
66 yyyyyyyyyyyyyyyyyyyyyyyyyyy,
71 [1 + 3, 4, 5, 6, 7, 7, fncall::<Vec<_>>(3 - 1)]
75 let items = itemize_list(
79 |item| item.span.lo(),
80 |item| item.span.hi(),
85 width: remaining_width,
98 |item| item.span.lo(),
99 |item| item.span.hi(),
104 width: remaining_width,
116 do_not, add, trailing, commas, inside, of, function, like, macros, even, if_they, are, long
119 baz!(one_item_macro_which_is_also_loooooooooooooooooooooooooooooooooooooooooooooooong);
121 let _ = match option {
131 Some(p) => baz!(one_item_macro_as_expression_which_is_also_loooooooooooooooong),
137 .compare_exchandsfasdsdfgsdgsdfgsdfgsdfgsdfgsdfgfsfdsage_weak(
151 if real_total <= limit
152 && !pre_line_comments
153 && !items.into_iter().any(|item| item.as_ref().is_multiline())
155 DefinitiveListTactic::Horizontal
186 let opt = Some(Struct(
197 do_thing(x, |param| {
211 lllllllllong_argument_one,
212 lllllllllong_argument_two,
213 lllllllllllllllllllllllllllllong_argument_three,
220 pparam1param1param1param1param1param1param1param1param1param1aram1,
234 Some(x) => somefunc(anotherfunc(
244 Some(x) => (1, 2, |x| {
249 Some(x) => SomeStruct {
250 f1: long_argument_one,
251 f2: long_argument_two,
252 f3: long_argument_three,
254 None => Ok(SomeStruct {
255 f1: long_argument_one,
256 f2: long_argument_two,
257 f3: long_argument_three,
262 y => func(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx),
265 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
276 /* This comment waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay too long to be kept on the same line */
279 this_last_arg_is_tooooooooooooooooooooooooooooooooo_long_to_be_kept_with_the_pre_comment,
284 let channel: &str = seq
286 .ok_or_else(|| de::Error::invalid_length(2, &self))?;