Compare commits

..

No commits in common. "0338b1cbdfa567d5f9580afef1d4483c7d275c32" and "f8d38320cd239d0abbd1b24fc972fd6f7f592ed9" have entirely different histories.

8 changed files with 25 additions and 59 deletions

24
Cargo.lock generated
View file

@ -151,9 +151,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.6" version = "4.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9689a29b593160de5bc4aacab7b5d54fb52231de70122626c178e6a368994c7" checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@ -161,9 +161,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.6" version = "4.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e5387378c84f6faa26890ebf9f0a92989f8873d4d380467bcd0d8d8620424df" checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@ -173,9 +173,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "4.5.5" version = "4.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro2", "proc-macro2",
@ -185,9 +185,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_lex" name = "clap_lex"
version = "0.7.1" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce"
[[package]] [[package]]
name = "colorchoice" name = "colorchoice"
@ -886,9 +886,9 @@ checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
[[package]] [[package]]
name = "utf8parse" name = "utf8parse"
version = "0.2.2" version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
[[package]] [[package]]
name = "version_check" name = "version_check"
@ -1093,9 +1093,9 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
[[package]] [[package]]
name = "winnow" name = "winnow"
version = "0.6.13" version = "0.6.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" checksum = "56c52728401e1dc672a56e81e593e912aa54c78f40246869f78359a2bf24d29d"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]

View file

@ -47,7 +47,7 @@ include = [
[dependencies] [dependencies]
anyhow = "1.0.86" anyhow = "1.0.86"
clap = { version = "4.5.6", features = ["derive"] } clap = { version = "4.5.4", features = ["derive"] }
crossterm = "0.27.0" crossterm = "0.27.0"
hashbrown = "0.14.5" hashbrown = "0.14.5"
notify-debouncer-mini = { version = "0.4.1", default-features = false } notify-debouncer-mini = { version = "0.4.1", default-features = false }

View file

@ -1,5 +1,3 @@
// Booleans (`bool`)
fn main() { fn main() {
let is_morning = true; let is_morning = true;
if is_morning { if is_morning {

View file

@ -1,6 +1,6 @@
// Characters (`char`)
fn main() { fn main() {
// Characters (`char`)
// Note the _single_ quotes, these are different from the double quotes // Note the _single_ quotes, these are different from the double quotes
// you've been seeing around. // you've been seeing around.
let my_first_initial = 'C'; let my_first_initial = 'C';
@ -12,12 +12,9 @@ fn main() {
println!("Neither alphabetic nor numeric!"); println!("Neither alphabetic nor numeric!");
} }
// TODO: Analogous to the example before, declare a variable called `your_character` let // Finish this line like the example! What's your favorite character?
// below with your favorite character. // Try a letter, try a number, try a special character, try a character
// Try a letter, try a digit (in single quotes), try a special character, try a character // from a different language than your own, try an emoji!
// from a different language than your own, try an emoji 😉
// let your_character = '';
if your_character.is_alphabetic() { if your_character.is_alphabetic() {
println!("Alphabetical!"); println!("Alphabetical!");
} else if your_character.is_numeric() { } else if your_character.is_numeric() {

View file

@ -1,11 +1,12 @@
// Create an array with at least 100 elements in it where the ??? is.
fn main() { fn main() {
// TODO: Create an array with at least 100 elements in it where the ??? is. let a = ???
// let a = ???
if a.len() >= 100 { if a.len() >= 100 {
println!("Wow, that's a big array!"); println!("Wow, that's a big array!");
} else { } else {
println!("Meh, I eat arrays like that for breakfast."); println!("Meh, I eat arrays like that for breakfast.");
panic!("Array not big enough, more elements needed"); panic!("Array not big enough, more elements needed")
} }
} }

View file

@ -250,7 +250,7 @@ name = "primitive_types3"
dir = "04_primitive_types" dir = "04_primitive_types"
test = false test = false
hint = """ hint = """
There's a shorthand to initialize arrays with a certain size that doesn't There's a shorthand to initialize Arrays with a certain size that does not
require you to type in 100 items (but you certainly can if you want!). require you to type in 100 items (but you certainly can if you want!).
For example, you can do: For example, you can do:

View file

@ -1,21 +1 @@
fn main() { // Solutions will be available before the stable release. Thank you for testing the beta version 🥰
let my_first_initial = 'C';
if my_first_initial.is_alphabetic() {
println!("Alphabetical!");
} else if my_first_initial.is_numeric() {
println!("Numerical!");
} else {
println!("Neither alphabetic nor numeric!");
}
// Example with an emoji.
let your_character = '🦀';
if your_character.is_alphabetic() {
println!("Alphabetical!");
} else if your_character.is_numeric() {
println!("Numerical!");
} else {
println!("Neither alphabetic nor numeric!");
}
}

View file

@ -1,11 +1 @@
fn main() { // Solutions will be available before the stable release. Thank you for testing the beta version 🥰
// An array with 100 elements of the value 42.
let a = [42; 100];
if a.len() >= 100 {
println!("Wow, that's a big array!");
} else {
println!("Meh, I eat arrays like that for breakfast.");
panic!("Array not big enough, more elements needed");
}
}