Fix compilation for rust nightly (#154)
Fixes by removing ambiguity between Ord::max and IndexType::max in two locations.
diff --git a/src/graph.rs b/src/graph.rs
index 1b50221..60c424a 100644
--- a/src/graph.rs
+++ b/src/graph.rs
@@ -486,7 +486,7 @@
let node = Node{weight: weight, next: [EdgeIndex::end(), EdgeIndex::end()]};
let node_idx = NodeIndex::new(self.nodes.len());
// check for max capacity, except if we use usize
- assert!(Ix::max().index() == !0 || NodeIndex::end() != node_idx);
+ assert!(<Ix as IndexType>::max().index() == !0 || NodeIndex::end() != node_idx);
self.nodes.push(node);
node_idx
}
@@ -523,7 +523,7 @@
pub fn add_edge(&mut self, a: NodeIndex<Ix>, b: NodeIndex<Ix>, weight: E) -> EdgeIndex<Ix>
{
let edge_idx = EdgeIndex::new(self.edges.len());
- assert!(Ix::max().index() == !0 || EdgeIndex::end() != edge_idx);
+ assert!(<Ix as IndexType>::max().index() == !0 || EdgeIndex::end() != edge_idx);
let mut edge = Edge {
weight: weight,
node: [a, b],