Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Nov 7, 2022
1 parent c37ca1e commit cf99475
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/armor/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn write(
(crc >> 8) as u8,
crc as u8,
];
let crc_enc = base64::encode_config(&crc_buf, base64::STANDARD);
let crc_enc = base64::encode_config(crc_buf, base64::STANDARD);

writer.write_all(crc_enc.as_bytes())?;

Expand Down
6 changes: 3 additions & 3 deletions src/packet/signature/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ impl Subpacket {
writer.write_all(&write_string(reason))?;
}
Subpacket::IsPrimary(is_primary) => {
let val = if *is_primary { 1u8 } else { 0u8 };
let val = u8::from(*is_primary);
writer.write_all(&[val])?;
}
Subpacket::Revocable(is_revocable) => {
let val = if *is_revocable { 1u8 } else { 0u8 };
let val = u8::from(*is_revocable);
writer.write_all(&[val])?;
}
Subpacket::EmbeddedSignature(inner_sig) => {
Expand Down Expand Up @@ -100,7 +100,7 @@ impl Subpacket {
writer.write_all(&write_string(regexp))?;
}
Subpacket::ExportableCertification(is_exportable) => {
let val = if *is_exportable { 1 } else { 0 };
let val = u8::from(*is_exportable);
writer.write_all(&[val])?;
}
Subpacket::IssuerFingerprint(version, fp) => {
Expand Down
4 changes: 2 additions & 2 deletions src/packet/signature/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl Signature {

let mut prefix_buf = [prefix, 0u8, 0u8, 0u8, 0u8];
BigEndian::write_u32(&mut prefix_buf[1..], packet_buf.len() as u32);
debug!("prefix: {}", hex::encode(&prefix_buf));
debug!("prefix: {}", hex::encode(prefix_buf));

// prefixes
hasher.update(&prefix_buf);
Expand Down Expand Up @@ -777,7 +777,7 @@ impl fmt::Debug for Signature {
f.debug_struct("Signature")
.field("packet_version", &self.packet_version)
.field("config", &self.config)
.field("signed_hash_value", &hex::encode(&self.signed_hash_value))
.field("signed_hash_value", &hex::encode(self.signed_hash_value))
.field(
"signature",
&format_args!(
Expand Down
2 changes: 1 addition & 1 deletion src/packet/user_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl fmt::Debug for UserAttribute {
.finish(),
UserAttribute::Unknown { typ, ref data, .. } => f
.debug_struct("UserAttribute::Image")
.field("type", &hex::encode(&[*typ]))
.field("type", &hex::encode([*typ]))
.field("data", &hex::encode(data))
.finish(),
}
Expand Down

0 comments on commit cf99475

Please sign in to comment.