wrapper 0.1.1

A trait for types that wrap other types.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use base::prelude::v1::*;
use base::borrow::Cow;

use crate::Wrapper;

impl<B: ?Sized + ToOwned> Wrapper<<B as ToOwned>::Owned> for Cow<'_, B> {
    fn into_inner(self) -> <B as ToOwned>::Owned {
        self.into_owned()
    }
}

impl<T> Wrapper<T> for Box<T> {
    fn into_inner(self) -> T {
        *self
    }
}