chore: initialize containerized Rust learning workbook

This commit is contained in:
soda64 committed 2026-11-30 22:07:47 +01:00
commit 05ffbd18bf
23 files changed
+549

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
# 05 — Generyki, Traity i Lifetimes
## Zakres
* Funkcje i typy generyczne (`<T: PartialOrd>`)
* Definiowanie i implementowanie traitów (`trait Summary`)
* Podstawowe adnotacje czasu życia (`'a`)
## Zadania (`src/lib.rs`)
1. `largest<T: PartialOrd>(items: &[T]) -> Option<&T>` — zwróć referencję do największego elementu w wycinku (lub `None` dla pustego wycinka).
2. Zaimplementuj trait `Summary` dla struktury `Article`.
3. `longest<'a>(x: &'a str, y: &'a str) -> &'a str` — zwróć dłuższy z dwóch napisów (gdy równe, zwróć `x`).
## Uruchomienie testów
```bash
make test PKG=ex05-generics-traits
```