Back to Library
Region:
Switch to ID
Intermediate Exercism • rust
vec! macro
Lesson Overview
# Introduction
vec![]
You can use Rust macros to generate vectors.
Syntax
vec![]uses a std Rust macro to initialize an emptyVec<T>vec![1; 3]initializes a vector with three onesvec![1, 2, 3]initializes a vector with the literal values 1, 2, 3
Originally from Exercism rust concepts