Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Foo;
- impl Foo {
- fn mutate(&mut self) {}
- }
- fn main() {
- let f = Foo;
- // f.mutate(); // compiler error - cannot borrow f as mutable
- { Foo }.mutate();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement