Use next instead of nth(0)

As suggested by clippy we can use `.next()` on an iterator instead of
`nth(0)`. Although arguably no clearer, and certainly no worse, it keeps
clippy quiet and a clean lint is a good thing.
This commit is contained in:
Tobin Harding committed 2021-02-24 13:30:47 +11:00
1 parent 79cab93d49
commit 824b00c9e0
1 file changed
+2 -2
+2 -2
View File
@@ -1942,7 +1942,7 @@ mod test {
assert_eq!(psbt.inputs[0].bip32_derivation.len(), 1);
assert_eq!(
psbt.inputs[0].bip32_derivation.values().nth(0).unwrap(),
psbt.inputs[0].bip32_derivation.values().next().unwrap(),
&(
Fingerprint::from_str("d34db33f").unwrap(),
DerivationPath::from_str("m/44'/0'/0'/0/0").unwrap()
@@ -1968,7 +1968,7 @@ mod test {
assert_eq!(psbt.outputs[0].bip32_derivation.len(), 1);
assert_eq!(
psbt.outputs[0].bip32_derivation.values().nth(0).unwrap(),
psbt.outputs[0].bip32_derivation.values().next().unwrap(),
&(
Fingerprint::from_str("d34db33f").unwrap(),
DerivationPath::from_str("m/44'/0'/0'/0/5").unwrap()