We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
.into()
AtomStoreCell
1 parent d0a885d commit 1e8edb4Copy full SHA for 1e8edb4
crates/swc_atoms/src/lib.rs
@@ -238,6 +238,8 @@ pub struct AtomStoreCell(UnsafeCell<AtomStore>);
238
impl AtomStoreCell {
239
#[inline]
240
pub fn atom<'a>(&self, s: impl Into<Cow<'a, str>>) -> Atom {
241
+ // evaluate the into before borrowing (see #8362)
242
+ let s: Cow<'a, str> = s.into();
243
// SAFETY: We can skip the borrow check of RefCell because
244
// this API enforces a safe contract. It is slightly faster
245
// to use an UnsafeCell. Note the borrow here is short lived
0 commit comments