@@ -72,17 +72,17 @@ impl<K: PartialEq, I, O> CallSpyMap<K, I, O> {
72
72
73
73
let guard = self . states . lock ( ) . unwrap_or_else ( |e| e. into_inner ( ) ) ;
74
74
75
- for ( key , state) in guard. iter ( ) {
75
+ for state in guard. iter ( ) {
76
76
if !state. results . is_empty ( ) {
77
- write ! ( & mut fail_pairs, "{}{:?} => {:?}" , prefix, key, & state. results)
77
+ write ! ( & mut fail_pairs, "{}{:?} => {:?}" , prefix, & state . key, & state. results)
78
78
. unwrap ( ) ;
79
79
prefix = ", " ;
80
80
}
81
81
}
82
82
83
83
drop ( guard) ; // don't poison
84
84
85
- if !result . is_empty ( ) {
85
+ if !fail_pairs . is_empty ( ) {
86
86
panic ! (
87
87
"Unexpected calls remaining for `{}`: {{{}}}" ,
88
88
self . name, fail_pairs
@@ -101,7 +101,7 @@ impl<K: PartialEq, I, O> CallSpyMap<K, I, O> {
101
101
102
102
' outer: for ( key, value) in expected. iter ( ) {
103
103
for ( k, v) in expected_map. iter_mut ( ) {
104
- if k == key {
104
+ if * k == key {
105
105
v. push ( value) ;
106
106
continue ' outer;
107
107
}
@@ -136,8 +136,8 @@ impl<K: PartialEq, I, O> CallSpyMap<K, I, O> {
136
136
137
137
' outer: for state in states {
138
138
for ( key, expected) in expected_map {
139
- if key == states . key {
140
- if !state. args . iter ( ) . eq ( expected) {
139
+ if key == state . key {
140
+ if !state. args . iter ( ) . eq ( & expected) {
141
141
return false ;
142
142
}
143
143
0 commit comments