Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
15
Task/Boolean-values/Rust/boolean-values.rs
Normal file
15
Task/Boolean-values/Rust/boolean-values.rs
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