We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7793f0 commit 1b636e9Copy full SHA for 1b636e9
src/atom.rs
@@ -254,8 +254,9 @@ impl<Static: StaticAtomSet> ops::Deref for Atom<Static> {
254
}
255
INLINE_TAG => {
256
let len = (self.unsafe_data() & LEN_MASK) >> LEN_OFFSET;
257
+ debug_assert!(len as usize <= MAX_INLINE_LEN);
258
let src = inline_atom_slice(&self.unsafe_data);
- str::from_utf8_unchecked(&src[..(len as usize)])
259
+ str::from_utf8_unchecked(src.get_unchecked(..(len as usize)))
260
261
STATIC_TAG => Static::get().atoms[self.static_index() as usize],
262
_ => debug_unreachable!(),
0 commit comments