Skip to content

Commit f9907b0

Browse files
committed
Use += operator
Clippy emits: warning: manual implementation of an assign operation As suggested, use += operator.
1 parent 5e0df21 commit f9907b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bitcoind-tests/tests/setup/test_util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl<'a> Translator<String, DescriptorPublicKey, ()> for StrDescPubKeyTranslator
159159
fn pk(&mut self, pk_str: &String) -> Result<DescriptorPublicKey, ()> {
160160
let avail = !pk_str.ends_with('!');
161161
if avail {
162-
self.0 = self.0 + 1;
162+
self.0 += 1;
163163
if pk_str.starts_with('K') {
164164
Ok(DescriptorPublicKey::Single(SinglePub {
165165
origin: None,
@@ -212,7 +212,7 @@ impl<'a> Translator<String, DescriptorPublicKey, ()> for StrTranslatorLoose<'a>
212212
fn pk(&mut self, pk_str: &String) -> Result<DescriptorPublicKey, ()> {
213213
let avail = !pk_str.ends_with('!');
214214
if avail {
215-
self.0 = self.0 + 1;
215+
self.0 += 1;
216216
if pk_str.starts_with('K') {
217217
Ok(DescriptorPublicKey::Single(SinglePub {
218218
origin: None,

0 commit comments

Comments
 (0)