Created
July 28, 2022 11:55
-
-
Save kriogenia/095023240b41fd5298140dfae98546ff to your computer and use it in GitHub Desktop.
Counter implementing Add Self
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl Add for Counter { | |
type Output = Counter; | |
fn add(self, rhs: Self) -> Self::Output { | |
Self(self.0 + rhs.0) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment