Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Boolean-values/Rust/boolean-values.rust
Normal file
15
Task/Boolean-values/Rust/boolean-values.rust
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
fn main() {
|
||||
// Rust contains a single boolean type: `bool`, represented by the keywords `true` and `false`.
|
||||
// Expressions inside `if` and `while` statements must result in type `bool`. There is no
|
||||
// automatic conversion to the boolean type.
|
||||
|
||||
let true_value = true;
|
||||
if true_value {
|
||||
println!("foo is {}.", true_value);
|
||||
}
|
||||
|
||||
let false_value = false;
|
||||
if !false_value {
|
||||
println!("bar is {}.", false_value);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue