How To Code Constants In Rust: The const Keyword

Jan 16, 2022

The keyword const is used to declare constants in Rust:

const ENV: &str = "production";

Constants are traditionally written in uppercase. The constant's name is followed by the constant's data type and its definitive value. The value cannot be changed later.

Need a technical writer with years of programming experience for your tech business? Hire me at Embarque