cow2 0.2.0

Like Cow, but T is covariant
Documentation

Like Cow, but T is covariant

Examples

Use std::borrow::Cow compile-fail case:

use std::borrow::Cow;

fn foo<'a>(_: Cow<'a, [Cow<'a, str>]>) { }
fn bar<'a>(x: Cow<'a, [Cow<'static, str>]>) {
    foo(x);
}

Use cow2::Cow compile-passed case:

use cow2::Cow;

fn foo<'a>(_: Cow<'a, [Cow<'a, str>]>) { }
fn bar<'a>(x: Cow<'a, [Cow<'static, str>]>) {
    foo(x);
}