Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 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