Skip to content

Commit

Permalink
Bump uncased dep; remove generated transmute
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jul 4, 2023
1 parent c9c35fd commit c70bb63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion phf_shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ std = []
[dependencies]
siphasher = "0.3"
unicase = { version = "2.4.0", optional = true }
uncased = { version = "0.9.6", optional = true, default-features = false }
uncased = { version = "0.9.9", optional = true, default-features = false }
7 changes: 2 additions & 5 deletions phf_shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,9 @@ impl PhfHash for uncased::UncasedStr {
#[cfg(feature = "uncased")]
impl FmtConst for uncased::UncasedStr {
fn fmt_const(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// transmute is not stable in const fns (rust-lang/rust#53605), so
// `UncasedStr::new` can't be a const fn itself, but we can inline the
// call to transmute here in the meantime.
f.write_str("unsafe { ::core::mem::transmute::<&'static str, &'static UncasedStr>(")?;
f.write_str("UncasedStr::new(")?;
self.as_str().fmt_const(f)?;
f.write_str(") }")
f.write_str(")")
}
}

Expand Down

0 comments on commit c70bb63

Please sign in to comment.