Skip to content

Instantly share code, notes, and snippets.

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