Hey all! I'm pretty new to Rust and did some work on a small, self-contained programming exercise. I've noticed that Rust often pushes you in the direction of a different design, which is something I am enjoying. Somewhat counter to that idea, I took a problem I've implemented in other languages (e.g. Python) and wanted to see what the experience would be like to "port" it over to Rust, realizing that it's probably best to rethink it from scratch next time.
In any event, the following is a very naive implementation of a "property management system". The system supports adding and removing units from a building. When a unit is added to a building, it is assigned a number. The numbers start sequentially from 1 and units are always assigned the lowest available number. For example, if three units are created and then added to the building, they would automatically be assigned the numbers 1, 2, and 3 respectively. If the second unit was removed (the one that was assigned the number 2) and another, new unit was then created and added to the building, it would be assigned the number 2 since that's now the lowest available unit number (rather than 4).
I'd love a review and I'm very interested in feedback/suggestions/guidance around how I'm handling mutability and borrowing (no surprise that this was the most challenging aspect for me). I more or less got this to work through a back and forth with the compiler. I'm sure there are different or better ways of doing everything here.
The code can be found here: Rust Playground
Thanks in advance!