@@ -37,7 +37,7 @@ impl<N: Eq + Ord + Clone, E: Default + Clone> Graph<N, E> {
37
37
self . nodes . get ( from) ?. get ( to)
38
38
}
39
39
40
- pub fn edges ( & self , from : & N ) -> impl Iterator < Item = & ( N , E ) > {
40
+ pub fn edges ( & self , from : & N ) -> impl Iterator < Item = ( & N , & E ) > {
41
41
self . nodes . get ( from) . into_iter ( ) . flat_map ( |x| x. iter ( ) )
42
42
}
43
43
@@ -95,8 +95,8 @@ impl<N: Eq + Ord + Clone, E: Default + Clone> Graph<N, E> {
95
95
p. iter ( )
96
96
// Note that we can have "cycles" introduced through dev-dependency
97
97
// edges, so make sure we don't loop infinitely.
98
- . find ( |& ( node, _) | !result. contains ( & node) )
99
- . map ( |( ref p, _) | p)
98
+ . find ( |( node, _) | !result. contains ( node) )
99
+ . map ( |( p, _) | p)
100
100
} ) {
101
101
result. push ( p) ;
102
102
pkg = p;
@@ -114,11 +114,11 @@ impl<N: Eq + Ord + Clone, E: Default + Clone> Graph<N, E> {
114
114
let first_pkg_depending_on = |pkg : & N , res : & [ & N ] | {
115
115
self . nodes
116
116
. iter ( )
117
- . filter ( |& ( _, adjacent) | adjacent. contains_key ( pkg) )
117
+ . filter ( |( _, adjacent) | adjacent. contains_key ( pkg) )
118
118
// Note that we can have "cycles" introduced through dev-dependency
119
119
// edges, so make sure we don't loop infinitely.
120
- . find ( |& ( node, _) | !res. contains ( & node) )
121
- . map ( |( ref p, _) | p)
120
+ . find ( |( node, _) | !res. contains ( node) )
121
+ . map ( |( p, _) | p)
122
122
} ;
123
123
while let Some ( p) = first_pkg_depending_on ( pkg, & result) {
124
124
result. push ( p) ;
0 commit comments