SHARE
TWEET

Untitled

a guest Jun 18th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pub trait Patator {
  2.     fn fire(&self) {
  3.         println!("paf!")
  4.     }
  5. }
  6.  
  7. pub struct CarrotLauncher;
  8.  
  9. impl Patator for CarrotLauncher {
  10.     fn fire(&self) {
  11.         print! {"pif-"};
  12.         SuperPatator.fire()
  13.     }
  14. }
  15.  
  16. struct SuperPatator;
  17.  
  18. impl Patator for SuperPatator {}
  19.  
  20. fn main() {
  21.     CarrotLauncher.fire()
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top