Skip to content

Implement clone_from for BTreeMap and BTreeSet #66648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Include empty BTreeMap in clone_from tests
  • Loading branch information
crgl committed Jan 28, 2020
commit 60a7c9421e78a29610e019b4030ca011bcd0bfd5
4 changes: 2 additions & 2 deletions src/liballoc/tests/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,17 +560,17 @@ fn test_clone_from() {
let size = 30;

for i in 0..size {
map1.insert(i, 10 * i);
let mut map2 = BTreeMap::new();
for j in 0..i {
map2.insert(100 * j + 1, 2 * j + 1);
let mut map1_copy = map2.clone();
map1_copy.clone_from(&map1);
assert_eq!(map1_copy, map1);
let mut map2_copy = map1.clone();
map2_copy.clone_from(&map2);
assert_eq!(map2_copy, map2);
map2.insert(100 * j + 1, 2 * j + 1);
}
map1.insert(i, 10 * i);
}
}

Expand Down