mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +03:00
clippy: fix needless_borrow
This commit is contained in:
@@ -174,7 +174,7 @@ pub async fn dc_get_securejoin_qr(context: &Context, group: Option<ChatId>) -> O
|
||||
if let Ok(chat) = Chat::load_from_db(context, group).await {
|
||||
let group_name = chat.get_name();
|
||||
let group_name_urlencoded =
|
||||
utf8_percent_encode(&group_name, NON_ALPHANUMERIC).to_string();
|
||||
utf8_percent_encode(group_name, NON_ALPHANUMERIC).to_string();
|
||||
|
||||
Some(format!(
|
||||
"OPENPGP4FPR:{}#a={}&g={}&x={}&i={}&s={}",
|
||||
@@ -489,7 +489,7 @@ pub(crate) async fn handle_securejoin_handshake(
|
||||
return Ok(HandshakeMessage::Ignore);
|
||||
}
|
||||
};
|
||||
if !token::exists(context, token::Namespace::InviteNumber, &invitenumber).await {
|
||||
if !token::exists(context, token::Namespace::InviteNumber, invitenumber).await {
|
||||
warn!(context, "Secure-join denied (bad invitenumber).");
|
||||
return Ok(HandshakeMessage::Ignore);
|
||||
}
|
||||
@@ -583,7 +583,7 @@ pub(crate) async fn handle_securejoin_handshake(
|
||||
return Ok(HandshakeMessage::Ignore);
|
||||
}
|
||||
};
|
||||
if !token::exists(context, token::Namespace::Auth, &auth_0).await {
|
||||
if !token::exists(context, token::Namespace::Auth, auth_0).await {
|
||||
could_not_establish_secure_connection(context, contact_chat_id, "Auth invalid.")
|
||||
.await;
|
||||
return Ok(HandshakeMessage::Ignore);
|
||||
|
||||
@@ -47,21 +47,21 @@ impl QrInvite {
|
||||
/// The fingerprint of the inviter.
|
||||
pub fn fingerprint(&self) -> &Fingerprint {
|
||||
match self {
|
||||
Self::Contact { fingerprint, .. } | Self::Group { fingerprint, .. } => &fingerprint,
|
||||
Self::Contact { fingerprint, .. } | Self::Group { fingerprint, .. } => fingerprint,
|
||||
}
|
||||
}
|
||||
|
||||
/// The `INVITENUMBER` of the setup-contact/secure-join protocol.
|
||||
pub fn invitenumber(&self) -> &str {
|
||||
match self {
|
||||
Self::Contact { invitenumber, .. } | Self::Group { invitenumber, .. } => &invitenumber,
|
||||
Self::Contact { invitenumber, .. } | Self::Group { invitenumber, .. } => invitenumber,
|
||||
}
|
||||
}
|
||||
|
||||
/// The `AUTH` code of the setup-contact/secure-join protocol.
|
||||
pub fn authcode(&self) -> &str {
|
||||
match self {
|
||||
Self::Contact { authcode, .. } | Self::Group { authcode, .. } => &authcode,
|
||||
Self::Contact { authcode, .. } | Self::Group { authcode, .. } => authcode,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user