Skip to content

Commit b0a358b

Browse files
committed
---
yaml --- r: 80719 b: refs/heads/try c: 653400a h: refs/heads/master i: 80717: d5e9aaf 80715: a216f64 80711: cf6b632 80703: 95d44ba v: v3
1 parent 5d180b8 commit b0a358b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cbd1eefbd350797b783df119fed7956d7e1c74ad
5-
refs/heads/try: 45c62c08f9740dfcdf64c64c8b183acfc22fb3d6
5+
refs/heads/try: 653400a7f0567ed1697ea9181132f7aaca5b2aae
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libstd/hashmap.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
1919
use clone::Clone;
2020
use cmp::{Eq, Equiv};
21+
use default::Default;
2122
use hash::Hash;
2223
use iter::{Iterator, FromIterator, Extendable};
2324
use iter::{FilterMap, Chain, Repeat, Zip};
@@ -622,6 +623,10 @@ impl<K: Eq + Hash, V> Extendable<(K, V)> for HashMap<K, V> {
622623
}
623624
}
624625

626+
impl<K: Eq + Hash, V> Default for HashMap<K, V> {
627+
fn default() -> HashMap<K, V> { HashMap::new() }
628+
}
629+
625630
/// An implementation of a hash set using the underlying representation of a
626631
/// HashMap where the value is (). As with the `HashMap` type, a `HashSet`
627632
/// requires that the elements implement the `Eq` and `Hash` traits.
@@ -770,6 +775,10 @@ impl<K: Eq + Hash> Extendable<K> for HashSet<K> {
770775
}
771776
}
772777

778+
impl<K: Eq + Hash> Default for HashSet<K> {
779+
fn default() -> HashSet<K> { HashSet::new() }
780+
}
781+
773782
// `Repeat` is used to feed the filter closure an explicit capture
774783
// of a reference to the other set
775784
/// Set operations iterator

0 commit comments

Comments
 (0)