Skip to content

Commit

Permalink
fix FmtConst for [u8]
Browse files Browse the repository at this point in the history
  • Loading branch information
abonander committed Jul 5, 2019
1 parent 7b415a4 commit 12b4fde
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion phf_shared/src/lib.rs
Expand Up @@ -88,7 +88,6 @@ macro_rules! delegate_debug(
);

delegate_debug!(str);
delegate_debug!([u8]);
delegate_debug!(char);
delegate_debug!(u8);
delegate_debug!(i8);
Expand Down Expand Up @@ -144,6 +143,14 @@ impl PhfHash for [u8] {
}
}

impl FmtConst for [u8] {
#[inline]
fn fmt_const(&self, f: &mut fmt::Formatter) -> fmt::Result {
// slices need a leading reference
write!(f, "&{:?}", self)
}
}

#[cfg(feature = "unicase")]
impl<S> PhfHash for unicase::UniCase<S>
where unicase::UniCase<S>: Hash {
Expand Down

0 comments on commit 12b4fde

Please sign in to comment.