Merge pull request #259 from noctune/csr-add-node-bug

Fix bug where Csr::add_node adds existing edges to new node
diff --git a/.travis.yml b/.travis.yml
index 3d19f3d..720573c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,9 +2,6 @@
 sudo: false
 matrix:
   include:
-    - rust: 1.15.0
-      env:
-      - ALL=' '
     - rust: 1.25.0
       env:
       - ALL=' '
diff --git a/Cargo.toml b/Cargo.toml
index 04be09d..ca207ec 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -36,7 +36,7 @@
 rand = "0.5.5"
 odds = { version = "0.2.19" }
 defmac = "0.1"
-itertools = { version = "0.7.0", default-features = false }
+itertools = { version = "0.8", default-features = false }
 
 [features]
 default = ["graphmap", "stable_graph"]
diff --git a/README.rst b/README.rst
index 383a709..0243d46 100644
--- a/README.rst
+++ b/README.rst
@@ -2,7 +2,7 @@
 petgraph
 ========
 
-Graph data structure library. Requires Rust 1.12.
+Graph data structure library. Requires Rust 1.25 or later.
 
 Please read the `API documentation here`__
 
@@ -39,7 +39,7 @@
 
 - 0.4.11
 
-  - Fix ``petgraph::graph::NodeReferences`` to be publically visible
+  - Fix ``petgraph::graph::NodeReferences`` to be publicly visible
   - Small doc typo and code style files by @shepmaster and @waywardmonkeys
   - Fix a future compat warning with pointer casts
 
diff --git a/src/algo/dominators.rs b/src/algo/dominators.rs
index 80380af..fd41140 100644
--- a/src/algo/dominators.rs
+++ b/src/algo/dominators.rs
@@ -108,7 +108,7 @@
 /// Algorithm"][0] discovered by Cooper et al.
 ///
 /// This algorithm is **O(|V|²)**, and therefore has slower theoretical running time
-/// than the Lenguaer-Tarjan algorithm (which is **O(|E| log |V|)**. However,
+/// than the Lengauer-Tarjan algorithm (which is **O(|E| log |V|)**. However,
 /// Cooper et al found it to be faster in practice on control flow graphs of up
 /// to ~30,000 vertices.
 ///
diff --git a/src/generate.rs b/src/generate.rs
index 65b1c65..91ea64a 100644
--- a/src/generate.rs
+++ b/src/generate.rs
@@ -56,7 +56,7 @@
 impl<Ty: EdgeType> Generator<Ty> {
     /// Generate all possible graphs of a particular number of vertices.
     ///
-    /// All permutations are generated, so the graphs are not unique down to isomorphim.
+    /// All permutations are generated, so the graphs are not unique down to isomorphism.
     ///
     /// For a graph of *k* vertices there are *e = k²* possible edges and
     /// *2<sup>k<sup>2</sup></sup>* graphs.
diff --git a/src/graph_impl/mod.rs b/src/graph_impl/mod.rs
index 29dfb87..e401c41 100644
--- a/src/graph_impl/mod.rs
+++ b/src/graph_impl/mod.rs
@@ -39,7 +39,7 @@
 
 /// Trait for the unsigned integer type used for node and edge indices.
 ///
-/// Marked `unsafe` because: the trait must faithfully preseve
+/// Marked `unsafe` because: the trait must faithfully preserve
 /// and convert index values.
 pub unsafe trait IndexType : Copy + Default + Hash + Ord + fmt::Debug + 'static
 {
diff --git a/src/graph_impl/stable_graph/mod.rs b/src/graph_impl/stable_graph/mod.rs
index 8819631..293efaa 100644
--- a/src/graph_impl/stable_graph/mod.rs
+++ b/src/graph_impl/stable_graph/mod.rs
@@ -445,7 +445,7 @@
     /// Invalidates the edge index `e` but no other.
     ///
     /// Computes in **O(e')** time, where **e'** is the number of edges
-    /// conneced to the same endpoints as `e`.
+    /// connected to the same endpoints as `e`.
     pub fn remove_edge(&mut self, e: EdgeIndex<Ix>) -> Option<E> {
         // every edge is part of two lists,
         // outgoing and incoming edges.
diff --git a/src/graph_impl/stable_graph/serialization.rs b/src/graph_impl/stable_graph/serialization.rs
index e44aa21..bc26c57 100644
--- a/src/graph_impl/stable_graph/serialization.rs
+++ b/src/graph_impl/stable_graph/serialization.rs
@@ -47,7 +47,7 @@
     edges: Vec<Edge<Option<E>, Ix>>,
 }
 
-/// Somes are the present node weights N, with known length.
+/// `Somes` are the present node weights N, with known length.
 struct Somes<T>(usize, T);
 
 impl<'a, N, Ix> Serialize for Somes<&'a [Node<Option<N>, Ix>]>
diff --git a/src/graphmap.rs b/src/graphmap.rs
index 6b6cab4..5adac89 100644
--- a/src/graphmap.rs
+++ b/src/graphmap.rs
@@ -51,7 +51,7 @@
 ///
 /// It uses an combined adjacency list and sparse adjacency matrix
 /// representation, using **O(|V| + |E|)** space, and allows testing for edge
-/// existance in constant time.
+/// existence in constant time.
 ///
 /// `GraphMap` is parameterized over:
 ///
@@ -132,7 +132,7 @@
         (self.nodes.capacity(), self.edges.capacity())
     }
 
-    /// Use their natual order to map the node pair (a, b) to a canonical edge id.
+    /// Use their natural order to map the node pair (a, b) to a canonical edge id.
     #[inline]
     fn edge_key(a: N, b: N) -> (N, N) {
         if Ty::is_directed() {
diff --git a/src/lib.rs b/src/lib.rs
index 7554774..7c6f82a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -153,7 +153,7 @@
 pub enum Undirected { }
 copyclone!(Undirected);
 
-/// A graph's edge type determines whether is has directed edges or not.
+/// A graph's edge type determines whether it has directed edges or not.
 pub trait EdgeType {
     fn is_directed() -> bool;
 }
diff --git a/src/visit/dfsvisit.rs b/src/visit/dfsvisit.rs
index e0ba22e..79df937 100644
--- a/src/visit/dfsvisit.rs
+++ b/src/visit/dfsvisit.rs
@@ -119,7 +119,7 @@
 ///
 /// If the return value of the visitor is simply `()`, the visit runs until it
 /// is finished. If the return value is a `Control<B>`, it can be used to
-/// change the control flow of the search. `Control::Break` will stop the
+/// change the control flow of the search. `Control::Break` will stop
 /// the visit early, returning the contained value from the function.
 /// `Control::Prune` will stop traversing any additional edges from the current
 /// node and proceed immediately to the `Finish` event.
diff --git a/src/visit/macros.rs b/src/visit/macros.rs
index 7fa3245..da24542 100644
--- a/src/visit/macros.rs
+++ b/src/visit/macros.rs
@@ -2,7 +2,7 @@
 /// Define a trait as usual, and a macro that can be used to instantiate
 /// implementations of it.
 ///
-/// There *must* be section markers in the trait defition:
+/// There *must* be section markers in the trait definition:
 /// @section type for associated types
 /// @section self for methods
 /// @section nodelegate for arbitrary tail that is not forwarded.
diff --git a/tests/graph.rs b/tests/graph.rs
index 78a49ea..2dceb1a 100644
--- a/tests/graph.rs
+++ b/tests/graph.rs
@@ -1422,12 +1422,12 @@
     let mut gr = Graph::new();
     let a = gr.add_node(Record { a: 1, b: r"abc\" });
     gr.add_edge(a, a, (1, 2));
-    let dot_output = format!("{:#?}", Dot::new(&gr));
+    let dot_output = format!("{:?}", Dot::new(&gr));
     assert_eq!(dot_output,
     // The single \ turns into four \\\\ because of Debug which turns it to \\ and then escaping each \ to \\.
 r#"digraph {
-    0 [label="Record {\l    a: 1,\l    b: \"abc\\\\\"\l}\l"]
-    0 -> 0 [label="(\l    1,\l    2\l)\l"]
+    0 [label="Record { a: 1, b: \"abc\\\\\" }"]
+    0 -> 0 [label="(1, 2)"]
 }
 "#);
 }