Description
https://doc.rust-lang.org/std/hash/
The example given tries to demonstrate the use of a SipHasher as well as its hash() function. But in doing so, it also creates a new function to display the resulting hash, and this new function is also called hash(). The new function returns a value, while the library hash() function does not.
Since many people expect a hash function to return a value, some confusion may occur due to the example function being named exactly the same as the built-in function while being used to do something many may expect (returning a value). This actually came up on IRC.
I suggest the function in the example should be called something other than hash(), maybe get_hash().
[alternatively, should the built-in function be called hash, since it's just collecting values and the hashing is done upon finish()?]
Another thing: SipHasher appears to be deprecated for direct use. Perhaps this example should use DefaultHasher instead? May be related to #29357.