diff --git a/proposal/images/ferris_does_not_compile.svg b/proposal/images/ferris_does_not_compile.svg new file mode 100644 index 0000000..48b7b4d --- /dev/null +++ b/proposal/images/ferris_does_not_compile.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/proposal/images/ferris_happy.svg b/proposal/images/ferris_happy.svg new file mode 100644 index 0000000..c7f240d --- /dev/null +++ b/proposal/images/ferris_happy.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/proposal/presentation.md b/proposal/presentation.md index c1f35b7..3cfed76 100644 --- a/proposal/presentation.md +++ b/proposal/presentation.md @@ -1,7 +1,7 @@ --- marp: true theme: default -class: invert +class: invert # Remove this line for light mode paginate: true --- @@ -16,8 +16,126 @@ Connor, Kyle, Sarvesh --- +# This is a Title! + +This is not a title + + +--- + + + +# **This is a different color Title!** + +_This is_ **just markdown** + + +--- + + +# This is Ferris! + +![bg right:50% 80%](./images/ferris_happy.svg) + + + +--- + + +# Example slides from Rust StuCo incoming: + + +--- + + +# `if` Expressions + +![bg right:25% 75%](./images/ferris_does_not_compile.svg) + +`if` expressions must condition on a boolean expression. + +```rust +fn main() { + let number = 3; + + if number { + println!("number was three"); + } +} +``` + +``` +error[E0308]: mismatched types + --> src/main.rs:4:8 + | +4 | if number { + | ^^^^^^ expected `bool`, found integer +``` + + +--- + + +# Matches Are Exhaustive + +![bg right:25% 75%](../images/ferris_does_not_compile.svg) + +The `match` patterns must cover all possible values that the matched expression may take. + +What happens when we miss a case? + +```rust +let x: i8 = 5; +let y: Option = Some(5); + +let sum = match y { + Some(num) => x + num, +}; +``` + + +--- + + +# Matches Are Exhaustive + +```rust +let x: i8 = 5; +let y: Option = Some(5); + +let sum = match y { + Some(num) => x + num, +}; +``` + +``` +error[E0004]: non-exhaustive patterns: `None` not covered + --> src/main.rs:6:21 + | +6 | let sum = match y { + | ^ pattern `None` not covered +``` + +* Forces us to explicitly handle the `None` case +* Protecting us from the billion-dollar mistake! + + +--- + + + + + +--- + + + + + +--- +--- \ No newline at end of file