The Set types currently implement all operations by reference. This was done initially to easily support generic types T which were Clone but not Copy. Potentially the compiler is able to optimize some of these away, but it's probably better to make it the user's explicit choice and let the borrow checker do its job.
The Set types currently implement all operations by reference. This was done initially to easily support generic types T which were Clone but not Copy. Potentially the compiler is able to optimize some of these away, but it's probably better to make it the user's explicit choice and let the borrow checker do its job.