2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(dead_code)]
|
2018-08-31 15:02:01 +02:00
|
|
|
#![allow(non_camel_case_types)]
|
2014-03-05 15:28:08 -08:00
|
|
|
|
2012-12-06 18:32:13 -08:00
|
|
|
struct trie_node {
|
2014-05-22 16:57:53 -07:00
|
|
|
content: Vec<String> ,
|
2014-03-05 14:02:44 -08:00
|
|
|
children: Vec<trie_node> ,
|
2012-12-06 18:32:13 -08:00
|
|
|
}
|
|
|
|
|
2014-05-22 16:57:53 -07:00
|
|
|
fn print_str_vector(vector: Vec<String> ) {
|
2015-01-31 12:20:46 -05:00
|
|
|
for string in &vector {
|
2014-01-09 21:06:55 +11:00
|
|
|
println!("{}", *string);
|
2012-12-06 18:32:13 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2013-02-22 16:08:16 -08:00
|
|
|
let mut node: trie_node = trie_node {
|
2014-03-05 14:02:44 -08:00
|
|
|
content: Vec::new(),
|
|
|
|
children: Vec::new()
|
2012-12-06 18:32:13 -08:00
|
|
|
};
|
2016-10-29 22:54:04 +01:00
|
|
|
let v = vec!["123".to_string(), "abc".to_string()];
|
|
|
|
node.content = vec!["123".to_string(), "abc".to_string()];
|
2012-12-06 18:32:13 -08:00
|
|
|
print_str_vector(v);
|
2013-03-15 18:27:15 -04:00
|
|
|
print_str_vector(node.content.clone());
|
2012-12-06 18:32:13 -08:00
|
|
|
|
|
|
|
}
|