You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for this library! I like it a lot.
I have a request:
I would like to make newtypes containing borrowed values, but it appears that doesn't work.
For example, this:
#[nutype(derive(Debug))]structA<'a>(Cow<'a,str>);
Expands to this:
#[doc(hidden)]mod __nutype_private_A__ {usesuper::*;#[derive(Debug,)]/// Lifetime on A is missingpubstructA(Cow<'a,str>);implA{pubfnnew(raw_value:Cow<'a,str>) -> Self{fnsanitize(mutvalue:Cow<'a,str>) -> Cow<'a,str>{ value }Self(sanitize(raw_value))}}implA{pubfninto_inner(self) -> Cow<'a,str>{self.0}}}use __nutype_private_A__::A
The important part is that the lifetime declaration on A seems to be lost. Is it possible to make this work?
The text was updated successfully, but these errors were encountered:
Ducky2048
changed the title
Support for Cow
Support for borrowing newtypes
Apr 15, 2024
First of all, thank you for this library! I like it a lot.
I have a request:
I would like to make newtypes containing borrowed values, but it appears that doesn't work.
For example, this:
Expands to this:
The important part is that the lifetime declaration on
A
seems to be lost. Is it possible to make this work?The text was updated successfully, but these errors were encountered: