Repository: paritytech/parity-bitcoin (language: rust)

Issue:
cannot use `state` because it was mutably borrowed
```
~/.opt/parity-bitcoin master
❯ cargo build --release
   Compiling getopts v0.2.15
   Compiling linked-hash-map v0.4.2
   Compiling slab v0.4.0
   Compiling serde v1.0.21
   Compiling quick-error v1.2.1
   Compiling utf8-ranges v1.0.0
error[E0503]: cannot use `state` because it was mutably borrowed
    --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/getopts-0.2.15/src/lib.rs:1033:33
     |
978  |     let mut machine = |cont: &mut bool, (i, c): (usize, char)| {
     |                       ---------------------------------------- borrow of `state` occurs here
...
982  |         state = match (state, whitespace, limit) {
     |                        ----- borrow occurs due to use of `state` in closure
...
1033 |     while cont && match state { B | C => true, A => false } {
     |                                 ^ use of borrowed `state`
1034 |         machine(&mut cont, (fake_i, ' '));
     |         ------- borrow later used here

error: aborting due to previous error

For more information about this error, try `rustc --explain E0503`.
error: Could not compile `getopts`.
warning: build failed, waiting for other jobs to finish...
error: build failed

~/.opt/parity-bitcoin master 7s
❯ git log -n1
commit d70cf432537ad0a595bfb5d20b22fde98fe47da6 (HEAD -> master, origin/master, origin/HEAD)
Merge: 40c3b37 a089130
Author: Nikolay Volf <nikvolf@gmail.com>
Date:   Tue Oct 1 11:32:13 2019 +0300

    Merge pull request #566 from D3v3sh5ingh/patch-1
    
    fixed typos and improved documentation

~/.opt/parity-bitcoin master
❯ uname -a
Linux host 5.3.1-arch1-1-ARCH #1 SMP PREEMPT Sat Sep 21 11:33:49 UTC 2019 x86_64 GNU/Linux

~/.opt/parity-bitcoin master
❯ rustc --version
rustc 1.38.0 (625451e37 2019-09-23)
```


Discussion / hints:

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index d559684ef..73378c97a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -377,7 +377,7 @@ dependencies = [
 
 [[package]]
 name = "getopts"
-version = "0.2.15"
+version = "0.2.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -897,7 +897,7 @@ name = "pulldown-cmark"
 version = "0.0.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "getopts 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1573,7 +1573,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "118b49cac82e04121117cbd3121ede3147e885627d82c4546b87c702debb90c1"
 "checksum futures-cpupool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "e86f49cc0d92fe1b97a5980ec32d56208272cbb00f15044ea9e2799dde766fdf"
 "checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb"
-"checksum getopts 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "65922871abd2f101a2eb0eaebadc66668e54a87ad9c3dd82520b5f86ede5eff9"
+"checksum getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "b900c08c1939860ce8b54dc6a89e26e00c04c380fd0e09796799bd7f12861e05"
 "checksum globset 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90d069fe6beb9be359ef505650b3f73228c5591a3c4b1f32be2f4f44459ffa3a"
 "checksum heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "556cd479866cf85c3f671209c85e8a6990211c916d1002c2fcb2e9b7cf60bc36"
 "checksum heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "54fab2624374e5137ae4df13bf32b0b269cb804df42d13a51221bbd431d1a237"


Test patch: