Vector is a core collection in Rust. Vector(Vec) can be used for storing a list of values or even if you need a Stack — it’s your data type. Rust language is pretty fast and secure however dealing with borrowing, ownership, and lifespan lifecycle is a high wall that often you can bash your head pretty hard against it. Returning Vecs and passing them as parameters could be pretty challenging if you were new to Rust. Strings also are pretty challenging in Rust. So today I want to share a video doing common operations with Vecs but always using functions and passing Vecs and Receiving Vecs. Hopefully, this will be useful in your common and daily work with Rust. Let’s get started!

The Video

The Code


Diego Pacheco

Originally published at on July 2, 2021.

Brazilian, Software Architect, SWE(Java, Scala, Rust, Go) SOA & DevOps expert, Author. Working with EKS/K8S. (Opinions on my own)