Knowledge Garden

Search

Search IconIcon to open search

Booleans in Rust

Last updated Dec 1, 2022 Edit Source

# Boolean

defined as -> bool

literals are -> true or false

Booleans are not integers so don’t try and use math on them, it wont work, To do this you must cast them

1
true as u8