Skip to content

Instantly share code, notes, and snippets.

@gong023
Created October 11, 2014 05:34
Show Gist options
  • Save gong023/f50c3a0b0a65c0151034 to your computer and use it in GitHub Desktop.
Save gong023/f50c3a0b0a65c0151034 to your computer and use it in GitHub Desktop.
trait Hoge {
fn hoge(&self) ->int;
}
impl<T> Hoge for Vec<T> {
fn hoge(&self) -> int { 1i }
}
fn main() {
let v = vec!(1i, 2, 3);
v.hoge();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment