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