feat: reorganize workbook into 3 tracks (core, engineering-2026, ecosystems)
This commit is contained in:
1 parent
82677455b2
commit
2e002b6176
64 files changed
+2295
-196
No files matched your search
@@ -0,0 +1,16 @@
|
||||
# 03 — Struktury, Enumy i Pattern Matching
|
||||
|
||||
## Zakres
|
||||
* Definiowanie `struct` oraz metod w blokach `impl`
|
||||
* `enum` z danymi (*algebraic data types*)
|
||||
* `match`, `Option<T>`
|
||||
|
||||
## Zadania (`src/lib.rs`)
|
||||
1. `Rectangle::area(&self) -> u32` oraz `Rectangle::can_hold(&self, other: &Rectangle) -> bool`.
|
||||
2. `Shape::area(&self) -> f64` dla enuma `Shape` (`Circle(f64)` oraz `Rect { width: f64, height: f64 }`).
|
||||
3. `safe_divide(a: f64, b: f64) -> Option<f64>` — `None` przy dzieleniu przez `0.0`, w przeciwnym razie `Some(a / b)`.
|
||||
|
||||
## Uruchomienie testów
|
||||
```bash
|
||||
make test PKG=core03-structs-enums
|
||||
```
|
||||
Reference in new issue
Block a user