clt_database/alloc/collections/rc.rs
1use super::{TryClone, TursoNewExt};
2use crate::alloc::Rc;
3
4fn rc<T>(value: T) -> Rc<T> {
5 Rc::new(value)
6}
7
8impl<T> TursoNewExt<T> for Rc<T> {
9 fn new(value: T) -> Self {
10 rc(value)
11 }
12}
13
14impl<T> TryClone for Rc<T> {
15 type Error = crate::alloc::AllocError;
16
17 fn try_clone(&self) -> Result<Self, Self::Error> {
18 Ok(self.clone())
19 }
20}