clippy: new lints

This commit is contained in:
Heiko Schaefer 2022-12-25 13:09:20 +01:00
parent 49b2e95f56
commit f40f2ffbfb
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D
2 changed files with 10 additions and 9 deletions

View file

@ -103,17 +103,17 @@ fn main() -> Result<(), Box<dyn Error>> {
println!();
let res = admin.set_name("Bar<<Foo")?;
println!("set name {:x?}", res);
admin.set_name("Bar<<Foo")?;
println!("set name - ok");
let res = admin.set_sex(Sex::NotApplicable)?;
println!("set sex {:x?}", res);
admin.set_sex(Sex::NotApplicable)?;
println!("set sex - ok");
let res = admin.set_lang(&[['e', 'n'].into()])?;
println!("set lang {:x?}", res);
admin.set_lang(&[['e', 'n'].into()])?;
println!("set lang - ok");
let res = admin.set_url("https://keys.openpgp.org")?;
println!("set url {:x?}", res);
admin.set_url("https://keys.openpgp.org")?;
println!("set url - ok");
let cert = Cert::from_file(TEST_KEY_PATH)?;
let p = StandardPolicy::new();

View file

@ -17,7 +17,8 @@ impl PWStatusBytes {
pub(crate) fn serialize_for_put(&self, long: bool) -> Vec<u8> {
let mut data = vec![];
data.push(if self.pw1_cds_valid_once { 0 } else { 1 });
// 0 if "valid once", 1 otherwise
data.push(u8::from(!self.pw1_cds_valid_once));
if long {
let mut b2 = self.pw1_len_format;