Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct MyStruct{
- x: i32
- }
- impl MyStruct{
- pub fn foo(&mut self){
- self.x = 5;
- }
- }
- trait Foo {
- fn foo_foo( &mut self )
- {
- self.foo();
- }
- }
- impl Foo for MyStruct{
- }
- fn main() {
- println!("Hello, world!");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement