fix clippy lint by using resize instead of push

This commit is contained in:
Riccardo Casatta 2024-05-10 17:38:24 +02:00
parent deeb160b86
commit 4646690521
No known key found for this signature in database
GPG Key ID: FD986A969E450397
1 changed files with 1 additions and 3 deletions

View File

@ -178,9 +178,7 @@ where
} }
// ... then reverse it and convert to chars // ... then reverse it and convert to chars
for _ in 0..leading_zero_count { ret.resize(ret.len() + leading_zero_count, 0);
ret.push(0);
}
for ch in ret.iter().rev() { for ch in ret.iter().rev() {
writer.write_char(BASE58_CHARS[*ch as usize] as char)?; writer.write_char(BASE58_CHARS[*ch as usize] as char)?;