Created
July 29, 2022 10:45
-
-
Save kriogenia/3ea8a64495371153141303e6cd6bab7f to your computer and use it in GitHub Desktop.
&Counter implementing Add<i16> and returning one i32
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<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