File tree 2 files changed +3
-6
lines changed
2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 2
2
Cargo.lock
3
3
* .swp
4
4
* .swo
5
+ .DS_Store
5
6
.cargo
Original file line number Diff line number Diff line change 1
1
extern crate radix_trie;
2
2
3
- use radix_trie:: Trie ;
3
+ use radix_trie:: { Trie , TrieCommon } ;
4
4
5
5
fn main ( ) {
6
6
let mut t = Trie :: new ( ) ;
@@ -9,16 +9,12 @@ fn main() {
9
9
t. insert ( "abb" , 6 ) ;
10
10
t. insert ( "abc" , 50 ) ;
11
11
12
- // FIXME
13
12
// This is a bit of a hack that relies on knowing the binary representation of
14
13
// strings... "abd" works, but "abz" doesn't...
15
- /*
16
- let ab_sum = t.get_raw_ancestor(&"abd").child_iter().fold(0, |acc, c| {
14
+ let ab_sum = t. get_raw_ancestor ( & "abd" ) . children ( ) . fold ( 0 , |acc, c| {
17
15
println ! ( "Iterating over child with value: {:?}" , c. value( ) ) ;
18
16
acc + * c. value ( ) . unwrap_or ( & 0 )
19
17
} ) ;
20
- */
21
- let ab_sum = 0 ;
22
18
println ! ( "{}" , ab_sum) ;
23
19
assert_eq ! ( ab_sum, 5 + 6 + 50 ) ;
24
20
}
You can’t perform that action at this time.
0 commit comments