Skip to content

Commit

Permalink
Remove iter struct test, it does not seem to add value
Browse files Browse the repository at this point in the history
  • Loading branch information
timvisee committed May 17, 2024
1 parent 10fe481 commit 41146f4
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,31 +496,4 @@ mod tests {
assert_eq!(Some(vnode2), iter.next());
assert_eq!(None, iter.next());
}

struct TestIterStruct {
ring: HashRing<String>,
}

impl TestIterStruct {
pub fn print_each(&self) -> Vec<String> {
let mut v = Vec::new();
for node in self.ring.clone().into_iter() {
v.push(node);
}
v
}
}

#[test]
fn into_iter_for_struct_field() {
let mut ring: HashRing<String> = HashRing::new();
ring.add("foo".to_string());
ring.add("bar".to_string());

let s = TestIterStruct { ring };

let v = s.print_each();

assert_eq!(v.len(), 2);
}
}

0 comments on commit 41146f4

Please sign in to comment.