mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
perf(span): add #[repr(transparent)] to Atom (#16310)
`Atom` is just a wrapper around a `&str`, so make it `#[repr(transparent)]`. This *may* help perf in some circumstances.
This commit is contained in:
1 parent
43a6c3209e
commit
ffca070d7a
1 file changed
+1
@@ -16,6 +16,7 @@ use crate::{CompactStr, ContentEq};
|
||||
///
|
||||
/// Use [CompactStr] with [Atom::to_compact_str] or [Atom::into_compact_str] for
|
||||
/// the lifetimeless form.
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, Copy, Eq)]
|
||||
pub struct Atom<'a>(&'a str);
|
||||
|
||||
|
||||
Reference in new issue
Block a user