Skip to content

Instantly share code, notes, and snippets.

@stiv-yakovenko
Created December 10, 2017 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stiv-yakovenko/e4448db2596c6ea5152afe6ee586c93e to your computer and use it in GitHub Desktop.
Save stiv-yakovenko/e4448db2596c6ea5152afe6ee586c93e to your computer and use it in GitHub Desktop.
rust_shit_code
pub fn sum(&self) -> i16 {
let mut r = 0i16;
for (_, v) in &self.0 {
r += *v as i16;
}
r
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment