Skip to content

Instantly share code, notes, and snippets.

@kriogenia
Created July 28, 2022 11:55
Show Gist options
  • Save kriogenia/095023240b41fd5298140dfae98546ff to your computer and use it in GitHub Desktop.
Save kriogenia/095023240b41fd5298140dfae98546ff to your computer and use it in GitHub Desktop.
Counter implementing Add Self
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