Remove unnecessary AsRef<str>.
This commit is contained in:
@@ -62,10 +62,7 @@ pub fn get_hasher() -> ahash::AHasher {
|
||||
/// The first module name is skipped. Hashing starts from the _second_ module in the chain.
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub fn calc_qualified_var_hash<'a>(
|
||||
modules: impl Iterator<Item = &'a str>,
|
||||
var_name: impl AsRef<str>,
|
||||
) -> u64 {
|
||||
pub fn calc_qualified_var_hash<'a>(modules: impl Iterator<Item = &'a str>, var_name: &str) -> u64 {
|
||||
let s = &mut get_hasher();
|
||||
|
||||
// We always skip the first module
|
||||
@@ -75,7 +72,7 @@ pub fn calc_qualified_var_hash<'a>(
|
||||
.skip(1)
|
||||
.for_each(|m| m.hash(s));
|
||||
len.hash(s);
|
||||
var_name.as_ref().hash(s);
|
||||
var_name.hash(s);
|
||||
s.finish()
|
||||
}
|
||||
|
||||
@@ -92,7 +89,7 @@ pub fn calc_qualified_var_hash<'a>(
|
||||
#[must_use]
|
||||
pub fn calc_qualified_fn_hash<'a>(
|
||||
modules: impl Iterator<Item = &'a str>,
|
||||
fn_name: impl AsRef<str>,
|
||||
fn_name: &str,
|
||||
num: usize,
|
||||
) -> u64 {
|
||||
let s = &mut get_hasher();
|
||||
@@ -104,7 +101,7 @@ pub fn calc_qualified_fn_hash<'a>(
|
||||
.skip(1)
|
||||
.for_each(|m| m.hash(s));
|
||||
len.hash(s);
|
||||
fn_name.as_ref().hash(s);
|
||||
fn_name.hash(s);
|
||||
num.hash(s);
|
||||
s.finish()
|
||||
}
|
||||
@@ -115,7 +112,7 @@ pub fn calc_qualified_fn_hash<'a>(
|
||||
/// Parameter types are passed in via [`TypeId`] values from an iterator.
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
pub fn calc_fn_hash(fn_name: impl AsRef<str>, num: usize) -> u64 {
|
||||
pub fn calc_fn_hash(fn_name: &str, num: usize) -> u64 {
|
||||
calc_qualified_fn_hash(empty(), fn_name, num)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user