HashSets

In the last chapter, we compared Ruby’s Hash to Rust’s HashMap. In this chapter, we are going to take a look at another of Rust’s standard collections–HashSet.

The name can be confusing for Rubyists. Rust’s HashSet is like Ruby’s lesser-known class–Set. So Rubyists can kind of ignore the word Hash in the name.

It is pretty straightforward, let’s dig into some examples.