rust: fix new clippy issues with MSRV update

pull/13396/head
Jason Ish 1 year ago committed by Victor Julien
parent 7de03a5ef3
commit 332bc6a05b

@ -809,7 +809,7 @@ impl JsonBuilder {
}
fn encode_base64(&mut self, val: &[u8]) -> Result<&mut Self, JsonError> {
let encoded_len = 4 * ((val.len() + 2) / 3);
let encoded_len = 4 * val.len().div_ceil(3);
if self.buf.capacity() < self.buf.len() + encoded_len {
self.buf.try_reserve(encoded_len)?;
}

@ -61,7 +61,7 @@ fn krb5_log_response(jsb: &mut JsonBuilder, tx: &KRB5Transaction) -> Result<(),
jsb.set_string("encryption", &encryption)?;
jsb.set_bool(
"weak_encryption",
tx.etype.map_or(false, test_weak_encryption),
tx.etype.is_some_and(test_weak_encryption),
)?;
if let Some(x) = tx.ticket_etype {
let refs = format!("{:?}", x);

@ -178,8 +178,7 @@ impl LdapState {
fn find_request(&mut self, message_id: MessageID) -> Option<&mut LdapTransaction> {
self.transactions.iter_mut().find(|tx| {
tx.request
.as_ref()
.map_or(false, |req| req.message_id == message_id)
.as_ref().is_some_and(|req| req.message_id == message_id)
})
}

Loading…
Cancel
Save