Fix some clippy warnings (#348)

* fix clippy patterns
* (clippy) dfsvisit: remove false loop by updating macro
* (clippy) visit: macro: delegate_impl!: make method ret types optional
* cargo fmt
diff --git a/src/csr.rs b/src/csr.rs
index 8a75e3f..50a9ce2 100644
--- a/src/csr.rs
+++ b/src/csr.rs
@@ -1,6 +1,6 @@
 //! Compressed Sparse Row (CSR) is a sparse adjacency matrix graph.
 
-use std::cmp::max;
+use std::cmp::{max, Ordering};
 use std::iter::{Enumerate, Zip};
 use std::marker::PhantomData;
 use std::ops::{Index, IndexMut, Range};
@@ -162,8 +162,9 @@
     {
         let max_node_id = match edges
             .iter()
-            .map(|edge| match edge.clone().into_weighted_edge() {
-                (x, y, _) => max(x.index(), y.index()),
+            .map(|edge| {
+                let (x, y, _) = edge.clone().into_weighted_edge();
+                max(x.index(), y.index())
             })
             .max()
         {
@@ -316,10 +317,10 @@
         let (index, neighbors) = self.neighbors_of(a);
         if neighbors.len() < BINARY_SEARCH_CUTOFF {
             for (i, elt) in neighbors.iter().enumerate() {
-                if b == *elt {
-                    return Ok(i + index);
-                } else if *elt > b {
-                    return Err(i + index);
+                match elt.cmp(&b) {
+                    Ordering::Equal => return Ok(i + index),
+                    Ordering::Greater => return Err(i + index),
+                    Ordering::Less => {}
                 }
             }
             Err(neighbors.len() + index)
diff --git a/src/lib.rs b/src/lib.rs
index 0ecef81..1dc36f7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -199,8 +199,8 @@
 impl Direction {
     /// Return the opposite `Direction`.
     #[inline]
-    pub fn opposite(&self) -> Direction {
-        match *self {
+    pub fn opposite(self) -> Direction {
+        match self {
             Outgoing => Incoming,
             Incoming => Outgoing,
         }
@@ -208,8 +208,8 @@
 
     /// Return `0` for `Outgoing` and `1` for `Incoming`.
     #[inline]
-    pub fn index(&self) -> usize {
-        (*self as usize) & 0x1
+    pub fn index(self) -> usize {
+        (self as usize) & 0x1
     }
 }
 
diff --git a/src/scored.rs b/src/scored.rs
index a4f88a9..b4da04b 100644
--- a/src/scored.rs
+++ b/src/scored.rs
@@ -39,10 +39,10 @@
             Ordering::Greater
         } else if a > b {
             Ordering::Less
-        } else if a != a && b != b {
+        } else if a.ne(a) && b.ne(b) {
             // these are the NaN cases
             Ordering::Equal
-        } else if a != a {
+        } else if a.ne(a) {
             // Order NaN less, so that it is last in the MinScore order
             Ordering::Less
         } else {
diff --git a/src/visit/dfsvisit.rs b/src/visit/dfsvisit.rs
index 0b7af3f..b14dad5 100644
--- a/src/visit/dfsvisit.rs
+++ b/src/visit/dfsvisit.rs
@@ -26,12 +26,17 @@
 /// if it is a prune value.
 macro_rules! try_control {
     ($e:expr, $p:stmt) => {
+        try_control!($e, $p, ());
+    };
+    ($e:expr, $p:stmt, $q:stmt) => {
         match $e {
             x => {
                 if x.should_break() {
                     return x;
                 } else if x.should_prune() {
                     $p
+                } else {
+                    $q
                 }
             }
         }
@@ -276,11 +281,9 @@
         return C::continuing();
     }
 
-    'prune: loop {
-        try_control!(
-            visitor(DfsEvent::Discover(u, time_post_inc(time))),
-            break 'prune
-        );
+    try_control!(
+        visitor(DfsEvent::Discover(u, time_post_inc(time))),
+        {},
         for v in graph.neighbors(u) {
             if !discovered.is_visited(&v) {
                 try_control!(visitor(DfsEvent::TreeEdge(u, v)), continue);
@@ -294,9 +297,7 @@
                 try_control!(visitor(DfsEvent::CrossForwardEdge(u, v)), continue);
             }
         }
-
-        break;
-    }
+    );
     let first_finish = finished.visit(u);
     debug_assert!(first_finish);
     try_control!(
diff --git a/src/visit/macros.rs b/src/visit/macros.rs
index c558b6e..1b36030 100644
--- a/src/visit/macros.rs
+++ b/src/visit/macros.rs
@@ -105,7 +105,7 @@
         @section self
         $(
             $(#[$_method_attr:meta])*
-            fn $method_name:ident(self $(: $self_selftype:ty)* $(,$marg:ident : $marg_ty:ty)*) -> $mret:ty;
+            fn $method_name:ident(self $(: $self_selftype:ty)* $(,$marg:ident : $marg_ty:ty)*) $(-> $mret:ty)?;
         )+
         )*
         // Arbitrary tail that is ignored when forwarding.
@@ -125,7 +125,7 @@
             )*
             $(
             $(
-                fn $method_name(self $(: $self_selftype)* $(,$marg: $marg_ty)*) -> $mret {
+                fn $method_name(self $(: $self_selftype)* $(,$marg: $marg_ty)*) $(-> $mret)? {
                     $self_map!(self).$method_name($($marg),*)
                 }
             )*
diff --git a/src/visit/mod.rs b/src/visit/mod.rs
index aa93c35..d34979a 100644
--- a/src/visit/mod.rs
+++ b/src/visit/mod.rs
@@ -626,7 +626,7 @@
     /// Create a new visitor map
     fn visit_map(self: &Self) -> Self::Map;
     /// Reset the visitor map (and resize to new size of graph if needed)
-    fn reset_map(self: &Self, map: &mut Self::Map) -> ();
+    fn reset_map(self: &Self, map: &mut Self::Map);
 }
 }
 Visitable! {delegate_impl []}