clbarnes / arbor-rs

MIT License
0 stars 1 forks source link

Travis' rustfmt has different configuration to local #18

Open clbarnes opened 5 years ago

clbarnes commented 5 years ago

See e.g. https://travis-ci.org/clbarnes/arbor-rs/jobs/456062812

I'm using a precommit hook which ensures that files are formatted with rustfmt $filepath. On travis, cargo fmt --all -- --check fails. The difference seems to be methods following a close parenthesis in a long chain (i.e. with linebreaks). Do they use different configurations by default? Is this related to the stable/nightly versions of rustfmt?

Diff in /home/travis/build/clbarnes/arbor-rs/src/arbor.rs at line 502:
             .map(|(dist, _prox)| {
                 self.edges.remove(&dist);
                 dist
-            })
-            .collect()
+            }).collect()
     }
clbarnes commented 5 years ago

Confirmed, it's dependent on which version of rust is being used. Travis doesn't like installing the nightly rustfmt on stable, though.