Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. struct MyStruct{
  2. x: i32
  3. }
  4.  
  5. impl MyStruct{
  6. pub fn foo(&mut self){
  7. self.x = 5;
  8. }
  9. }
  10.  
  11. trait Foo {
  12. fn foo_foo( &mut self )
  13. {
  14. self.foo();
  15. }
  16. }
  17.  
  18. impl Foo for MyStruct{
  19. }
  20.  
  21. fn main() {
  22. println!("Hello, world!");
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement