Skip to content

newtype_derive for generic types #26

@veldsla

Description

@veldsla

I tried to use a generic type in the with the custom_derive / newtype_derive macro, but that doesn't compile. See also rust-bio/rust-bio#101.

custom_derive! {
    #[derive(NewtypeFrom, NewtypeDeref, Debug, Clone)]
    pub struct Interval<N>(Range<N>);
}

Looking around I think the macro doesn't currently parse the type. If I look at the effort in rust-parse-generics it also seems quite complicated. Do you expect to support this in the (near) future, or should I manually do the newtype?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions