Clippy: avoid extra heap allocation.

This commit is contained in:
Heiko Schaefer 2022-07-16 12:55:18 +02:00
parent f9ed6c30c0
commit 6267451652
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

View file

@ -5,7 +5,7 @@
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};
use std::convert::{TryFrom, TryInto}; use std::convert::{TryFrom, TryInto};
use std::fmt::{Display, Formatter}; use std::fmt::{Display, Formatter, Write};
use std::time::{Duration, UNIX_EPOCH}; use std::time::{Duration, UNIX_EPOCH};
use crate::{algorithm::Algo, tlv::Tlv, Error, KeySet, KeyType, Tags}; use crate::{algorithm::Algo, tlv::Tlv, Error, KeySet, KeyType, Tags};
@ -960,7 +960,7 @@ impl Fingerprint {
let mut fp = String::new(); let mut fp = String::new();
for i in 0..20 { for i in 0..20 {
fp.push_str(&format!("{:02X}", self.0[i])); let _ = write!(&mut fp, "{:02X}", self.0[i]);
if i < 19 && (i % 2 == 1) { if i < 19 && (i % 2 == 1) {
fp.push(' '); fp.push(' ');