Skip to content

Commit

Permalink
refactor(span): rename Atom::new_const method (#8480)
Browse files Browse the repository at this point in the history
#8479 introduced `Atom::r#static` method. Rename it to
`Atom::new_const`, to match `CompactStr::new_const` which does the same
thing.
  • Loading branch information
overlookmotel authored Jan 14, 2025
1 parent 4ad695d commit de5b288
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/oxc_span/src/atom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ pub struct Atom<'a>(&'a str);
impl Atom<'static> {
/// Get an [`Atom`] containing a static string.
#[inline]
pub const fn r#static(s: &'static str) -> Self {
pub const fn new_const(s: &'static str) -> Self {
Atom(s)
}

/// Get an [`Atom`] containing the empty string (`""`).
#[inline]
pub const fn empty() -> Self {
Self::r#static("")
Self::new_const("")
}
}

Expand Down

0 comments on commit de5b288

Please sign in to comment.