alexcrichton / openssl-probe

Apache License 2.0
54 stars 13 forks source link

Fix use after move error introduced in new Rust version #10

Closed timvisee closed 5 years ago

timvisee commented 5 years ago

Apparently, the following two use-after-move problems were introduced when compiling with newer Rust versions:

error[E0382]: use of partially moved value: `cert_file`
  --> src/lib.rs:68:5
   |
52 |         Some(path) => put(ENV_CERT_FILE, path),
   |              ---- value moved here
...
68 |     cert_file.is_some() || cert_dir.is_some()
   |     ^^^^^^^^^ value used here after move
   |
   = note: move occurs because the value has type `std::path::PathBuf`, which does not implement the `Copy` trait

error[E0382]: use of partially moved value: `cert_dir`
  --> src/lib.rs:68:28
   |
56 |         Some(path) => put(ENV_CERT_DIR, path),
   |              ---- value moved here
...
68 |     cert_file.is_some() || cert_dir.is_some()
   |                            ^^^^^^^^ value used here after move
   |
   = note: move occurs because the value has type `std::path::PathBuf`, which does not implement the `Copy` trait

This PR fixes these issues.

alexcrichton commented 5 years ago

Thanks!