Generics can be super useful when you don't care about the specifics of a given type aside from very specific requirements. If we inform the Rust compiler that we only care about certain requirements, we can write one implementation that applies to a wide array of types instead of an implementation of a trait for every type.
This trait implementation can panic! Can you fix the panics caused by out of bounds indexing?
GitHub: github.com/rust-adventure/yt-...
Негізгі бет Ғылым және технология Generic Traits, Impls, and Slices in Rustlang
Пікірлер: 40