about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-03-15 21:03:29 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-03-15 21:03:29 -0400
commit98900d55e7f08a4b4cb665152a01b0bbf655baae (patch)
tree0122148c60409df74af80a9092b9f3e45d2fd33f
parent6859a6d9a327d7fcd81a38c8e3af6aa0005f7944 (diff)
downloadrust-98900d55e7f08a4b4cb665152a01b0bbf655baae.tar.gz
rust-98900d55e7f08a4b4cb665152a01b0bbf655baae.zip
add constructor to TrieSet (was missing)
-rw-r--r--src/libcore/trie.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcore/trie.rs b/src/libcore/trie.rs
index 966db4ec662..d6dcad33408 100644
--- a/src/libcore/trie.rs
+++ b/src/libcore/trie.rs
@@ -137,6 +137,7 @@ impl<T> Map<uint, T> for TrieMap<T> {
 }
 
 impl<T> TrieMap<T> {
+    /// Create an empty TrieMap
     #[inline(always)]
     static pure fn new() -> TrieMap<T> {
         TrieMap{root: TrieNode::new(), length: 0}
@@ -191,6 +192,12 @@ impl Mutable for TrieSet {
 }
 
 impl TrieSet {
+    /// Create an empty TrieSet
+    #[inline(always)]
+    static pure fn new() -> TrieSet {
+        TrieSet{map: TrieMap::new()}
+    }
+
     /// Return true if the set contains a value
     #[inline(always)]
     pure fn contains(&self, value: &uint) -> bool {