Loading...
CONCEPT

Rust: Tuples

Learn about Tuples, one of Rust's compound data types.

avatar
rohitpaulk
Concept Author
3 min reading time

Tuple is a Rust data type that is used to group multiple values.

It's defined using parantheses, for example:

// Here `(char, i32)` is variable's type, and `('A', 5)` is the value assigned to it
let chess_square: (char, i32) = ('A', 5);