Skip to content

Commit

Permalink
util: Allow hash_ref for unsized types
Browse files Browse the repository at this point in the history
  • Loading branch information
jix committed Sep 29, 2024
1 parent c96d8b9 commit 0a28d7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ pub fn hash_value<T: std::hash::Hash>(value: T) -> u64 {
/// This forwards to [`hash_value`]. Restricting the argument to be a reference is occasionally
/// useful for type inference or for avoiding warnings.
#[inline]
pub fn hash_ref<T: std::hash::Hash>(value: &T) -> u64 {
pub fn hash_ref<T: std::hash::Hash + ?Sized>(value: &T) -> u64 {
hash_value(value)
}

0 comments on commit 0a28d7c

Please sign in to comment.