Skip to content

Commit

Permalink
Fix build issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
turbocool3r committed Jan 6, 2022
1 parent cf0f6ec commit ee82cc9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions phf_shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ impl PhfHash for char {
}

// minimize duplicated code since formatting drags in quite a bit
fn fmt_array<T: std::fmt::Debug>(array: &[T], f: &mut fmt::Formatter<'_>) -> fmt::Result {
fn fmt_array<T: core::fmt::Debug>(array: &[T], f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{:?}", array)
}

Expand All @@ -373,19 +373,19 @@ macro_rules! array_impl (
impl<const N: usize> PhfHash for [$t; N] {
#[inline]
fn phf_hash<H: Hasher>(&self, state: &mut H) {
for v in self {
for v in &self[..] {
v.phf_hash(state);
}
}
}

impl<const N: usize> FmtConst for [$t; N] {
impl<const N: usize> FmtConst for [$t; N] {
fn fmt_const(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt_array(self, f)
}
}

impl<const N: usize> PhfBorrow<[$t]> for [$t; N] {
impl<const N: usize> PhfBorrow<[$t]> for [$t; N] {
fn borrow(&self) -> &[$t] {
self
}
Expand Down

0 comments on commit ee82cc9

Please sign in to comment.