1 // rustfmt-normalize_comments: true
2 // rustfmt-single_line_if_else_max_width: 0
3 // rustfmt-chain_indent: Visual
4 // Test chain formatting.
7 // Don't put chains on a single line if it wasn't so in source.
8 let a = b.c.d.1.foo(|x| x + 1);
10 bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc
11 .ddddddddddddddddddddddddddd();
13 bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc
14 .ddddddddddddddddddddddddddd
17 // Test case where first chain element isn't a path, but is shorter than
19 x().y(|| match cond() {
24 loong_func().quux(move || if true {
30 some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
35 some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
39 .method_call_b(aaaaa, bbbbb, |c| {
44 fffffffffffffffffffffffffffffffffff(a, {
45 SCRIPT_TASK_ROOT.with(|root| { *root.borrow_mut() = Some(&script_task); });
48 let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum =
49 xxxxxxx.map(|x| x + 5)
51 .fold(0, |acc, x| acc + x);
53 aaaaaaaaaaaaaaaa.map(|x| {
57 .filter(some_mod::some_filter)
81 // params are 1-indexed
83 mparams[match cur.to_digit(10) {
84 Some(d) => d as usize - 1,
85 None => return Err("bad param number".to_owned()),
99 Foo { x: val }.baz(|| {
120 fn is_replaced_content() -> bool {
121 constellat.send(ConstellationMsg::ViewportConstrained(self.id, constraints))
128 std::mem::transmute(dl.symbol::<()>("init").unwrap())
132 let names = String::from_utf8(names)?.split('|')
137 fn issue1217() -> Result<Mnemonic, Error> {
138 let random_chars: String = OsRng::new()?.gen_ascii_chars()
139 .take(self.bit_length)
142 Ok(Mnemonic::new(&random_chars))
145 fn issue1236(options: Vec<String>) -> Result<Option<String>> {
146 let process = Command::new("dmenu").stdin(Stdio::piped())
147 .stdout(Stdio::piped())
149 .chain_err(|| "failed to spawn dmenu")?;
155 PrototypeIdData::from_reader::<_, B>(&mut self.file_cursor).chain_err(|| {
157 "could not read prototype ID at offset {:#010x}",