Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub enum InnerStream {
- Root,
- Transaction { v: Vec<u32>, parent: Box<InnerStream> },
- }
- impl InnerStream {
- pub fn rollback(self) -> InnerStream {
- match self {
- InnerStream::Transaction { v: _v, parent } => {
- match *parent {
- InnerStream::Root => InnerStream::Root,
- InnerStream::Transaction { v, parent: parent_parent } =>
- InnerStream::Transaction { v, parent: parent_parent }
- }
- },
- InnerStream::Root { .. } => panic!("Cannot rollback root stream."),
- }
- }
- }
- error[E0382]: use of collaterally moved value: `(parent as InnerStream::Transaction).parent`
- --> src/main.rs:12:59
- |
- 12 | InnerStream::Transaction { v, parent: parent_parent } =>
- | - ^^^^^^^^^^^^^ value used here after move
- | |
- | value moved here
- |
- = note: move occurs because the value has type `std::vec::Vec<u32>`, which does not implement the `Copy` trait
- error: aborting due to previous error
Add Comment
Please, Sign In to add comment