Something like this?
[String, 0]
Vec::new()
is not an option.
This creates an empty array:
let thing: [String; 0] = [];
You can also get a slice from the array:
let thing: &[String] = &[];
You can also use as
:
some_function([] as [String; 0]);
some_function(&[] as &[String]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With