Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
add marp example
Browse files Browse the repository at this point in the history
  • Loading branch information
connortsui20 committed Jan 30, 2024
1 parent 9ddcd99 commit 26df8f3
Show file tree
Hide file tree
Showing 3 changed files with 224 additions and 1 deletion.
72 changes: 72 additions & 0 deletions proposal/images/ferris_does_not_compile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions proposal/images/ferris_happy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
120 changes: 119 additions & 1 deletion proposal/presentation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
marp: true
theme: default
class: invert
class: invert # Remove this line for light mode
paginate: true
---

Expand All @@ -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<i8> = Some(5);

let sum = match y {
Some(num) => x + num,
};
```


---


# Matches Are Exhaustive

```rust
let x: i8 = 5;
let y: Option<i8> = 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!


---





---





---





---

0 comments on commit 26df8f3

Please sign in to comment.