lunar-lib 0.11.2

Common utilities for lunar applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::sync::Arc;

pub trait ArcExt<T> {
    /// Always clones the inner value of the [`Arc`] and returns it
    fn clone_and_unwrap(this: Arc<T>) -> T
    where
        T: Clone;
}

impl<T> ArcExt<T> for Arc<T> {
    fn clone_and_unwrap(this: Arc<T>) -> T
    where
        T: Clone,
    {
        (*this).clone()
    }
}