You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
317 B
20 lines
317 B
2 years ago
|
struct Test {
|
||
|
value1: String,
|
||
|
value2: Vec<String>,
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
let a = Test {
|
||
|
value1: "string".into(),
|
||
|
value2: vec!["a".into(), "b".into()],
|
||
|
};
|
||
|
|
||
|
let Test {
|
||
|
value1,
|
||
|
value2: list,
|
||
|
} = a;
|
||
|
|
||
|
println!("Name: {:?}", value1);
|
||
|
println!("List: {:?}", list);
|
||
|
}
|