1 // rustfmt-normalize_comments: true
2 // rustfmt-indent_style: Visual
3 // Test chain formatting.
6 // Don't put chains on a single line if it wasn't so in source.
7 let a = b.c.d.1.foo(|x| x + 1);
9 bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc
10 .ddddddddddddddddddddddddddd();
12 bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc
13 .ddddddddddddddddddddddddddd
16 // Test case where first chain element isn't a path, but is shorter than
18 x().y(|| match cond() {
23 loong_func().quux(move || if true { 1 } else { 2 });
25 some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
30 some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
34 .method_call_b(aaaaa, bbbbb, |c| {
39 fffffffffffffffffffffffffffffffffff(a, {
40 SCRIPT_TASK_ROOT.with(|root| {
41 *root.borrow_mut() = Some(&script_task);
45 let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum =
46 xxxxxxx.map(|x| x + 5)
48 .fold(0, |acc, x| acc + x);
50 aaaaaaaaaaaaaaaa.map(|x| {
54 .filter(some_mod::some_filter)
58 let z = Foo { field1: val1,
61 let x = Foo { field1: val1,
62 field2: val2, }.method_call()
65 let y = if cond { val1 } else { val2 }.method_call();
70 // params are 1-indexed
71 stack.push(mparams[match cur.to_digit(10) {
72 Some(d) => d as usize - 1,
73 None => return Err("bad param number".to_owned()),
86 Foo { x: val }.baz(|| {
92 Foo { y: i_am_multi_line,
105 fn is_replaced_content() -> bool {
106 constellat.send(ConstellationMsg::ViewportConstrained(self.id, constraints))
113 std::mem::transmute(dl.symbol::<()>("init").unwrap())
117 let names = String::from_utf8(names)?.split('|')
122 fn issue1217() -> Result<Mnemonic, Error> {
123 let random_chars: String = OsRng::new()?.gen_ascii_chars()
124 .take(self.bit_length)
127 Ok(Mnemonic::new(&random_chars))
130 fn issue1236(options: Vec<String>) -> Result<Option<String>> {
131 let process = Command::new("dmenu").stdin(Stdio::piped())
132 .stdout(Stdio::piped())
134 .chain_err(|| "failed to spawn dmenu")?;
140 PrototypeIdData::from_reader::<_, B>(&mut self.file_cursor).chain_err(|| {
141 format!("could not read prototype ID at offset {:#010x}",