refactor(span): rename Atom::new_const method (#8480)

#8479 introduced `Atom::r#static` method. Rename it to
`Atom::new_const`, to match `CompactStr::new_const` which does the same
thing.
This commit is contained in:
overlookmotel 2025-01-14 09:16:32 +00:00 committed by GitHub
parent 4ad695dcfb
commit de5b28809a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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("")
}
}