Skip to content

Instantly share code, notes, and snippets.

@ihcsim
Last active February 1, 2022 21:03
Show Gist options
  • Save ihcsim/22028af6a0ef5d0b459b7b4b50a840fa to your computer and use it in GitHub Desktop.
Save ihcsim/22028af6a0ef5d0b459b7b4b50a840fa to your computer and use it in GitHub Desktop.
$ cargo run
Compiling rust-ownership v0.1.0 (/home/isim/rust-ownership)
error[E0507]: cannot move out of index of `Vec<Service>`
--> src/main.rs:19:17
|
19 | let nginx = svcs[0];
| ^^^^^^^
| |
| move occurs because value has type `Service`, which does not implement the `Copy` trait
| help: consider borrowing here: `&svcs[0]`
For more information about this error, try `rustc --explain E0507`.
error: could not compile `rust-ownership` due to previous error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment