Why do I have to derive(Debug, Hash, PartialEq, Eq, Clone, Copy) when using the newtype pattern in @rustlang ?
Also, how about `let age = Years(5) + 1`;
https://doc.rust-lang.org/rust-by-example/generics/new_types.html …
-
-
The problem for me is in the proper. I only saw examples that defined Add for the same type. Could not convince Rust to accept my `impl Add for Year { .. fn add(self, other: i64) -> Year ...` if that is possible for the Add Trait.
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.