Introduction

Completed

In this module, we explore compound data types in Rust. The Rust language provides array and vector types to store data collections. You'll discover how to implement if/else expressions to test data in collection types. As an exercise, you'll write a Rust program to build cars by processing a data collection and testing values.

The Rust Playground

The Rust Playground is a browser interface to the Rust compiler. You can use the Playground to experiment writing Rust code before you install the language locally, or when you might not have the compiler available. Throughout this course, we'll give Playground links to the example code and exercises. You can interact with the code, even if you don't have the Rust toolchain available at the moment.

All code that runs on the Rust Playground can also compile and run in your local development environment. Don't be discouraged to interact with the Rust compiler from your computer. You can learn more about the Rust Playground in the What is Rust? module.

Learning objectives

In this module, you'll:

  • Explore Rust compound data types: arrays and vectors.
  • Discover how to use if/else statements to test conditions in a Rust program.
  • Create, compile, and run a Rust program to process compound data and test values.