Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement