Skip to content

Commit

Permalink
Fix(Lesson 04): break slide into two
Browse files Browse the repository at this point in the history
  • Loading branch information
holubond committed Oct 8, 2023
1 parent 323af37 commit 03c7773
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions slides/04-data-structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,17 +363,19 @@ Poskytuje výchozí hodnotu.
trait Default {
fn default() -> Self;
}
```

```rust
impl Default for String {
fn default() -> String {
String::new()
}
}
```
Používá se pro metody jako `Option::unwrap_or_default()`.

---

# Default

Používá se pro metody jako `Option::unwrap_or_default()`.

```rust
let value_option: Option<String> = ...;
Expand Down

0 comments on commit 03c7773

Please sign in to comment.