[Solved] How to add variable length array into a Vec?

[ad_1]

What have you tried? The straight translation of your example works:

fn main() {
    let mut a = vec![];
    a.push(vec![1, 2]);
    a.push(vec![1, 2, 3]);
    a.push(vec![1, 2, 3, 4]);
    a.push(vec![1, 2, 3]);
    println!("{:?}", a);
}

Playground

[ad_2]

solved How to add variable length array into a Vec?