the title is a bit misleading IMO; it doesn't generate a collision, it just generates a rainbow table and looks for matches on the fly.
Seems standard enough, learning that a Vector is a resizable Array was needed, the auto closing sockets and files is cool. But what on Earth is string.into() ?
Not asking for an answer just pointing out that’s not a very useful name.
It's very strange for main to return something, the logic should be wrapped in a different function and the error checking done from main.
undefined
This is a good intro and really highlights how Rust doesn't have a learning curve, it has a cliff. I'm tackling this in my own book [0] because I think the docs really throw you in the deep end (mixing metaphors). As this article shows, to implement a "hello world" you have to use a macro, so you can't even look for a function signature in the standard library docs to help. So you can either just say "don't worry about this for now, just trust me" or spend a whole chapter diving into macro syntax. And then it goes into errors, which in this example need to be boxed, so then you can spend a bunch of time explaining unsized types and boxing and memory allocation... or just say that it has to be boxed to keep the compiler happy.
Teaching Rust is basically a giant topological sorting exercise [1] where you're finding the optimal order to introduce syntax so that you steer clear of all of these rabbit holes. Or you just end up drawing the owl.
[0] https://rftgu.rs/ [1] https://en.wikipedia.org/wiki/Topological_sorting