1 // rustfmt-normalize_comments: true
2 // rustfmt-single_line_if_else_max_width: 0
3 // rustfmt-chain_width: 100
4 // Test chain formatting.
7 let a = b.c.d.1.foo(|x| x + 1);
9 bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddd();
12 .ccccccccccccccccccccccccccccccccccccc
13 .ddddddddddddddddddddddddddd
16 let f = fooooooooooooooooooooooooooooooooooooooooooooooooooo
17 .baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar;
19 // Test case where first chain element isn't a path, but is shorter than
21 x().y(|| match cond() {
26 loong_func().quux(move || {
34 some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
39 some_fuuuuuuuuunction()
40 .method_call_a(aaaaa, bbbbb, |c| {
44 .method_call_b(aaaaa, bbbbb, |c| {
49 fffffffffffffffffffffffffffffffffff(a, {
50 SCRIPT_TASK_ROOT.with(|root| {
51 *root.borrow_mut() = Some(&script_task);
55 let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum =
56 xxxxxxx.map(|x| x + 5).map(|x| x / 2).fold(0, |acc, x| acc + x);
63 .filter(some_mod::some_filter)
87 // params are 1-indexed
89 mparams[match cur.to_digit(10) {
90 Some(d) => d as usize - 1,
91 None => return Err("bad param number".to_owned()),
127 fn is_replaced_content() -> bool {
128 constellat.send(ConstellationMsg::ViewportConstrained(self.id, constraints)).unwrap();
134 std::mem::transmute(dl.symbol::<()>("init").unwrap())
139 let y = expr.kaas()?.test();
140 let loooooooooooooooooooooooooooooooooooooooooong =
141 does_this?.look?.good?.should_we_break?.after_the_first_question_mark?;
142 let yyyy = expr?.another?.another?.another?.another?.another?.another?.another?.another?.test();
143 let zzzz = expr?.another?.another?.another?.another?;
144 let aaa = x??????????????????????????????????????????????????????????????????????????;
147 .loooooooooooooooooooooooooooooooooooooong()
155 parameterized(f, substs, def_id, Ns::Value, &[], |tcx| {
156 tcx.lookup_item_type(def_id).generics
158 fooooooooooooooooooooooooooo()?
160 .baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz()?;
165 ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i),
166 ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i),
167 ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i),
170 ty::tls::with(|tcx| {
171 let tap = ty::Binder(TraitAndProjections(principal, projections));
172 in_binder(f, tcx, &ty::Binder(""), Some(tap))
191 fn save(&self) -> Result<()> {
192 let mut file = File::create(&settings_path)
193 .chain_err(|| ErrorKind::WriteError(settings_path.clone()))?;