Skip to content

Instantly share code, notes, and snippets.

@kriogenia
Created July 29, 2022 07:07
Show Gist options
  • Save kriogenia/480f39123b4af3c3f6653549eafc9531 to your computer and use it in GitHub Desktop.
Save kriogenia/480f39123b4af3c3f6653549eafc9531 to your computer and use it in GitHub Desktop.
&Coutner implementing Add<Self>
impl Add for &Counter {
type Output = Counter;
fn add(self, rhs: Self) -> Self::Output {
Counter(self.0 + rhs.0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment