add some utility From<Interned<T>> impls
This commit is contained in:
parent
aec383c0af
commit
eed0afc6ab
|
@ -764,6 +764,24 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: 'static + Clone + Send + Sync, C: InternContext> From<Interned<[T], C>> for Vec<T> {
|
||||
fn from(value: Interned<[T], C>) -> Self {
|
||||
Vec::from(&*value.guard())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: 'static + Clone + Send + Sync, C: InternContext> From<Interned<[T], C>> for Box<[T]> {
|
||||
fn from(value: Interned<[T], C>) -> Self {
|
||||
Box::from(&*value.guard())
|
||||
}
|
||||
}
|
||||
|
||||
impl<C: InternContext> From<Interned<str, C>> for String {
|
||||
fn from(value: Interned<str, C>) -> Self {
|
||||
String::from(&*value.guard())
|
||||
}
|
||||
}
|
||||
|
||||
impl<I, C: InternContext<AllContextsAreIdentical = ConstBool<true>> + Default> Default
|
||||
for Interned<[I], C>
|
||||
where
|
||||
|
|
Loading…
Reference in a new issue