Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct A {
- b: B,
- c: C,
- }
- #[derive(Clone)]
- struct B {}
- struct C {}
- impl A {
- fn some_action(&mut self) -> B {
- //some actions with self.b
- // return self.b
- return self.b.clone();
- }
- }
- fn main() {
- let mut a = A { b: B {}, c: C {} };
- let b = a.some_action();
- }
Add Comment
Please, Sign In to add comment