You've already forked rust-tutor
generic types, traits and lifetimes
- get claude to create rustlings style exercises based on chapter 10 of the book - update CLAUDE.md to prevent it from producing incorrect exercises - complete exercises/01-generic-cache-system
This commit is contained in:
15
exercises/01-generic-cache-system/README.md
Normal file
15
exercises/01-generic-cache-system/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Generic Cache System
|
||||
|
||||
Build a simple key-value cache that can store any types. You'll write generic functions that manage cached data, demonstrating how generics let you write one implementation that works with strings, numbers, or any other type.
|
||||
|
||||
## What you'll practice
|
||||
|
||||
- Writing generic functions with multiple type parameters `<K, V>`
|
||||
- Using trait bounds to constrain what types can be used
|
||||
- Working with `HashMap<K, V>` and generic collections
|
||||
- Combining `Option<T>` and `Result<T, E>` with generics
|
||||
|
||||
## Further information
|
||||
|
||||
- [Generic Data Types](https://doc.rust-lang.org/book/ch10-01-syntax.html)
|
||||
- [Using Trait Bounds](https://doc.rust-lang.org/book/ch10-02-traits.html#using-trait-bounds-to-conditionally-implement-methods)
|
||||
Reference in New Issue
Block a user