Compare commits

...

2 commits

Author SHA1 Message Date
mo8it 990c68efcb primitive_types1 solution 2024-05-25 16:31:21 +02:00
mo8it 8d4145038d Update deps 2024-05-25 16:15:35 +02:00
4 changed files with 22 additions and 11 deletions

8
Cargo.lock generated
View file

@ -506,9 +506,9 @@ dependencies = [
[[package]]
name = "parking_lot"
version = "0.12.2"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb"
checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
dependencies = [
"lock_api",
"parking_lot_core",
@ -825,9 +825,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.65"
version = "2.0.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106"
checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5"
dependencies = [
"proc-macro2",
"quote",

View file

@ -1,14 +1,12 @@
// Fill in the rest of the line that has code missing!
fn main() {
// Booleans (`bool`)
let is_morning = true;
if is_morning {
println!("Good morning!");
}
let // Finish the rest of this line like the example! Or make it be false!
// TODO: Define a boolean variable with the name `is_evening` before the `if` statement below.
// The value of the variable should be the negation (opposite) of `is_morning`.
// let …
if is_evening {
println!("Good evening!");
}

View file

@ -234,7 +234,10 @@ hint = "No hints this time ;)"
name = "primitive_types1"
dir = "04_primitive_types"
test = false
hint = "No hints this time ;)"
hint = """
In Rust, a boolean can be negated using the operator `!` before it.
Example: `!true == false`
This also works with boolean variables."""
[[exercises]]
name = "primitive_types2"

View file

@ -1 +1,11 @@
// Solutions will be available before the stable release. Thank you for testing the beta version 🥰
fn main() {
let is_morning = true;
if is_morning {
println!("Good morning!");
}
let is_evening = !is_morning;
if is_evening {
println!("Good evening!");
}
}