Closed Nicholas-Baron closed 3 years ago
I'll look over this tonight I think. Nothing looks crazy to me off hand. There's no reason to believe hashing the hash is going to be a problem, other than a performance hit. I do wish there was a better way, but I don't know of one off-hand.
@jordanbray Are there any comments from your review that I should implement?
Sorry for the delay. This all looks good to me. I ran some performance tests just to be sure nothing funky happened, and it didn't.
Solves #44
This PR makes
Board
possible to use as the key of a standard RustHashMap
. Most of the changes are additions to#[derive]
attribute for the types.Of note is the
impl Hash for Board
. Thehash
function does not return its result and instead has a&mut Hasher
parameter to hold the state of the hash. The current solution is to only hashself.hash
. This is faster than the#[derive]
, as it is only one field, but I do not know the implications of using a hash of a hash.