Skip to content

Instantly share code, notes, and snippets.

@ihcsim
Last active February 1, 2022 21:17
Show Gist options
  • Save ihcsim/c5b5d9ab6afe323e746864a9bf72e02c to your computer and use it in GitHub Desktop.
Save ihcsim/c5b5d9ab6afe323e746864a9bf72e02c to your computer and use it in GitHub Desktop.
$ cargo run
Compiling rust-ownership v0.1.0 (/home/isim/rust-ownership)
error[E0382]: borrow of moved value: `svc`
--> src/main.rs:9:25
|
2 | let svc = "nginx.default".to_string();
| --- move occurs because `svc` has type `String`, which does not implement the `Copy` trait
...
5 | println!("svc: {}", fqdn(svc));
| --- value moved here
...
9 | println!("svc: {}", svc);
| ^^^ value borrowed here after move
For more information about this error, try `rustc --explain E0382`.
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