Automatically implement traits of enclosed type for Rust newtypes (tuple structs with one field)
is there a way to do it without extracting their “inner” values every time with pattern matching, and without implementing the Add, Sub, … traits and overloading operators? No, the only way is to implement the traits manually. Rust doesn’t have an equivalent to the Haskell’s GHC extension GeneralizedNewtypeDeriving which allows deriving on wrapper types … Read more