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