Skip to content

Commit 98900d5

Browse files
committed
add constructor to TrieSet (was missing)
1 parent 6859a6d commit 98900d5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libcore/trie.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ impl<T> Map<uint, T> for TrieMap<T> {
137137
}
138138

139139
impl<T> TrieMap<T> {
140+
/// Create an empty TrieMap
140141
#[inline(always)]
141142
static pure fn new() -> TrieMap<T> {
142143
TrieMap{root: TrieNode::new(), length: 0}
@@ -191,6 +192,12 @@ impl Mutable for TrieSet {
191192
}
192193

193194
impl TrieSet {
195+
/// Create an empty TrieSet
196+
#[inline(always)]
197+
static pure fn new() -> TrieSet {
198+
TrieSet{map: TrieMap::new()}
199+
}
200+
194201
/// Return true if the set contains a value
195202
#[inline(always)]
196203
pure fn contains(&self, value: &uint) -> bool {

0 commit comments

Comments
 (0)