Searching with Iterators using Structs
Learn about Rust's core concepts such as iterators and pattern matching in a struct.
We'll cover the following
Though visitors are now represented as structures, we still need to be able to search them. We could use the same search code as before, comparing your_name
with visitor.name
to call the greeting method directly, but this method isn’t ideal. This gets unwieldy as our visitors become more complicated and we add more visitors to the list.
Get hands-on with 1400+ tech skills courses.