Here are the key points from this section:
- The syntax for generic types is <T>, where T can be of any valid Rust type.
- In every block where it is used, it needs to be declared before it can be used. For instance, when declaring a function, <T> is declared just before the argument list.
- The generic type, Option, in the standard library is used to represent any value that might be nothing.
- The generic type, Result, is used to represent operations that may or may not succeed.
Here are a couple of tasks for you:
- Take a look at the collection types, documented in https://doc.rust-lang.org/stable/std/collections/.
- Use HashMap for any key-value type pairs you choose.
- Use BTreeMap for any key-value type pairs.
- Take a look at ...