Check also the formatting in CI
diff --git a/.travis.yml b/.travis.yml
index f32ebc8..9abc48e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,7 +7,8 @@
- ALL=' '
- rust: stable
env:
- - FEATURES='unstable quickcheck'
+ - FEATURES='unstable quickcheck'
+ - CHECKFMT=1
- rust: beta
- rust: nightly
- rust: nightly
@@ -17,9 +18,15 @@
branches:
only:
- master
+before_script:
+ - rustup component add rustfmt
script:
- |
cargo build --verbose --no-default-features &&
cargo test --verbose --no-default-features &&
cargo build --verbose --features "$FEATURES" &&
cargo test ${ALL:---all} --verbose --features "$FEATURES"
+ if [ "${CHECKFMT}" == "1"]; then
+ cargo +stable fmt -- --check
+ fi
+
diff --git a/src/algo/dominators.rs b/src/algo/dominators.rs
index 85c2b63..c3cd1c3 100644
--- a/src/algo/dominators.rs
+++ b/src/algo/dominators.rs
@@ -167,8 +167,8 @@
.filter(|&&p| dominators[p] != UNDEFINED);
let new_idom_idx = predecessors.next().expect(
"Because the root is initialized to dominate itself, and is the \
- first node in every path, there must exist a predecessor to this \
- node that also has a dominator",
+ first node in every path, there must exist a predecessor to this \
+ node that also has a dominator",
);
predecessors.fold(*new_idom_idx, |new_idom_idx, &predecessor_idx| {
intersect(&dominators, new_idom_idx, predecessor_idx)
diff --git a/src/graph_impl/serialization.rs b/src/graph_impl/serialization.rs
index 30f258b..e108f3d 100644
--- a/src/graph_impl/serialization.rs
+++ b/src/graph_impl/serialization.rs
@@ -158,7 +158,7 @@
if input.is_directed() != Ty::is_directed() {
Err(E2::custom(format_args!(
"graph edge property mismatch, \
- expected {:?}, found {:?}",
+ expected {:?}, found {:?}",
EdgeProperty::from(PhantomData::<Ty>),
input
)))
@@ -277,7 +277,7 @@
{
E::custom(format_args!(
"invalid value: node index `{}` does not exist in graph \
- with node bound {}",
+ with node bound {}",
node_index, len
))
}