refclone 0.3.0

Mark a type, whose clone operation does not changes it's deref value. Ex Rc,Arc
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
mod tuple;
use std::{rc::Rc, sync::Arc};

pub unsafe trait RefClone {
    fn ref_clone(&self) -> Self;
}
unsafe impl<T> RefClone for Rc<T> {
    fn ref_clone(&self) -> Self { self.clone() }
}
unsafe impl<T> RefClone for Arc<T> {
    fn ref_clone(&self) -> Self { self.clone() }
}