Compare commits

...

2 commits

Author SHA1 Message Date
mo8it 532c9ebb30 primitive_types5 solution 2024-06-19 14:17:06 +02:00
mo8it 2a1bc53771 Update deps 2024-06-19 14:03:06 +02:00
4 changed files with 16 additions and 9 deletions

6
Cargo.lock generated
View file

@ -516,7 +516,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
"redox_syscall 0.5.1", "redox_syscall 0.5.2",
"smallvec", "smallvec",
"windows-targets 0.52.5", "windows-targets 0.52.5",
] ]
@ -606,9 +606,9 @@ dependencies = [
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.5.1" version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd"
dependencies = [ dependencies = [
"bitflags 2.5.0", "bitflags 2.5.0",
] ]

View file

@ -1,8 +1,8 @@
// Destructure the `cat` tuple so that the println will work.
fn main() { fn main() {
let cat = ("Furry McFurson", 3.5); let cat = ("Furry McFurson", 3.5);
let /* your pattern here */ = cat;
println!("{} is {} years old.", name, age); // TODO: Destructure the `cat` tuple in one statement so that the println works.
// let /* your pattern here */ = cat;
println!("{name} is {age} years old");
} }

View file

@ -286,7 +286,7 @@ Particularly the part about destructuring (second to last example in the
section). section).
You'll need to make a pattern to bind `name` and `age` to the appropriate parts You'll need to make a pattern to bind `name` and `age` to the appropriate parts
of the tuple. You can do it!!""" of the tuple."""
[[exercises]] [[exercises]]
name = "primitive_types6" name = "primitive_types6"

View file

@ -1 +1,8 @@
// Solutions will be available before the stable release. Thank you for testing the beta version 🥰 fn main() {
let cat = ("Furry McFurson", 3.5);
// Destructuring the tuple.
let (name, age) = cat;
println!("{name} is {age} years old");
}