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
Thanks your awesome work on nutype, it has been very helpful!
I was thinking, since the new() method can fail, this could be better described by adding a try_ prefix (e.g. try_new()).
Since Rust already has the TryFrom trait (had a little trouble implementing it myself), I'd like to suggest that to be the de-facto way to create nutypes objects.
What do you think?
The text was updated successfully, but these errors were encountered:
Consider fallible new is typically bad practice, I'm thinking that if a type has validation, no ::new() should be generated, and possibly the TryFrom trait should be auto-implemented. This was what I expected coming into the library and was surprised that the signature of ::new() changed between my nutypes that did and didn't have validation.
Hello! =)
Thanks your awesome work on
nutype
, it has been very helpful!I was thinking, since the
new()
method can fail, this could be better described by adding atry_
prefix (e.g. try_new()
).Since Rust already has the
TryFrom
trait (had a little trouble implementing it myself), I'd like to suggest that to be the de-facto way to create nutypes objects.What do you think?
The text was updated successfully, but these errors were encountered: