From 98900d55e7f08a4b4cb665152a01b0bbf655baae Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Fri, 15 Mar 2013 21:03:29 -0400 Subject: [PATCH] add constructor to TrieSet (was missing) --- src/libcore/trie.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libcore/trie.rs b/src/libcore/trie.rs index 966db4ec6620..d6dcad334085 100644 --- a/src/libcore/trie.rs +++ b/src/libcore/trie.rs @@ -137,6 +137,7 @@ impl Map for TrieMap { } impl TrieMap { + /// Create an empty TrieMap #[inline(always)] static pure fn new() -> TrieMap { 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 {