hstr/
global_store.rs

1use std::borrow::Cow;
2
3use crate::{dynamic::global_atom, Atom};
4
5macro_rules! direct_from_impl {
6    ($T:ty) => {
7        impl From<$T> for Atom {
8            fn from(s: $T) -> Self {
9                global_atom(&s)
10            }
11        }
12    };
13}
14
15direct_from_impl!(&'_ str);
16direct_from_impl!(Cow<'_, str>);
17direct_from_impl!(String);
18
19impl From<Box<str>> for crate::Atom {
20    fn from(s: Box<str>) -> Self {
21        global_atom(&s)
22    }
23}