greyblake / nutype

Rust newtype with guarantees 🇺🇦 🦀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Derive AsRef for generic newtype

greyblake opened this issue · comments

The following types should compile and work as expected:

use nutype::nutype;
use std::borrow::Cow;

#[nutype(derive(AsRef))]
struct NotEmpty<T>(Vec<T>);

#[nutype(derive(AsRef))]
struct Clarabelle<'a>(Cow<'a, str>);

Make sure to have a proper test coverage