operator

Rust <=: include the maximum allowed value

Use `<=` for a maximum that is allowed as well as smaller values. Expected output (not executed): true Why: Exactly 20 kilograms is within this limit. Common mistake: Do not use `<` if the maximum itself is allowed. Advanced connection: `std::cmp::PartialOrd::le`.

Formal Syntax & Structure

rust syntaxrust
a <= b

Working Example

Example Snippetrust
fn main() {    let baggage_kg = 20;    let allowed_kg = 20;    println!("{}", baggage_kg <= allowed_kg);}
Rust Reference