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 @@
|
||||
# 04 — Dobre Praktyki w Ruście (Errors, Display, From, Doctests)
|
||||
|
||||
## Zakres
|
||||
* Implementacja standardowych traitów `fmt::Display` i `std::error::Error` (fundament tego, co generuje `thiserror`)
|
||||
* Konwersja błędów przez `From<E>` dla czystego operatora `?`
|
||||
* Dokumentacja publicznego API i **doctesty** (testy wewnątrz komentarzy `///`)
|
||||
|
||||
## Zadania (`src/lib.rs`)
|
||||
1. Zaimplementuj `fmt::Display` i `std::error::Error` dla `ConfigError`.
|
||||
2. Zaimplementuj `From<ParseIntError>` dla `ConfigError`.
|
||||
3. Zaimplementuj `parse_timeout_secs(raw: &str) -> Result<u64, ConfigError>` (odrzuca puste wejście jako `Missing`, błędy parsowania przez `?`, a wartości `0` lub `> 300` jako `OutOfRange(u64)`).
|
||||
|
||||
## Uruchomienie testów
|
||||
```bash
|
||||
make test PKG=eng04-best-practices
|
||||
```
|
||||
Reference in new issue
Block a user