happy clippy

This commit is contained in:
dignifiedquire
2020-05-22 11:37:12 +02:00
parent d1f9563e1f
commit 28ef5164ce
5 changed files with 14 additions and 16 deletions

View File

@@ -1295,8 +1295,8 @@ pub async fn get_by_contact_id(context: &Context, contact_id: u32) -> Result<Cha
Ok(chat_id) Ok(chat_id)
} }
pub async fn prepare_msg<'a>( pub async fn prepare_msg(
context: &'a Context, context: &Context,
chat_id: ChatId, chat_id: ChatId,
msg: &mut Message, msg: &mut Message,
) -> Result<MsgId, Error> { ) -> Result<MsgId, Error> {

View File

@@ -166,6 +166,7 @@ impl Context {
} }
} }
#[allow(clippy::too_many_arguments)]
async fn exec_step( async fn exec_step(
ctx: &Context, ctx: &Context,
imap: &mut Imap, imap: &mut Imap,

View File

@@ -275,6 +275,7 @@ impl Params {
/// created without copying if the path already referes to a valid /// created without copying if the path already referes to a valid
/// blob. If so a [BlobObject] will be returned regardless of the /// blob. If so a [BlobObject] will be returned regardless of the
/// `create` argument. /// `create` argument.
#[allow(clippy::needless_lifetimes)]
pub async fn get_blob<'a>( pub async fn get_blob<'a>(
&self, &self,
key: Param, key: Param,

View File

@@ -381,30 +381,26 @@ impl Scheduler {
} }
async fn interrupt_inbox(&self) { async fn interrupt_inbox(&self) {
match self { if let Scheduler::Running { ref inbox, .. } = self {
Scheduler::Running { ref inbox, .. } => inbox.interrupt().await, inbox.interrupt().await;
_ => {}
} }
} }
async fn interrupt_mvbox(&self) { async fn interrupt_mvbox(&self) {
match self { if let Scheduler::Running { ref mvbox, .. } = self {
Scheduler::Running { ref mvbox, .. } => mvbox.interrupt().await, mvbox.interrupt().await;
_ => {}
} }
} }
async fn interrupt_sentbox(&self) { async fn interrupt_sentbox(&self) {
match self { if let Scheduler::Running { ref sentbox, .. } = self {
Scheduler::Running { ref sentbox, .. } => sentbox.interrupt().await, sentbox.interrupt().await;
_ => {}
} }
} }
async fn interrupt_smtp(&self) { async fn interrupt_smtp(&self) {
match self { if let Scheduler::Running { ref smtp, .. } = self {
Scheduler::Running { ref smtp, .. } => smtp.interrupt().await, smtp.interrupt().await;
_ => {}
} }
} }

View File

@@ -184,7 +184,7 @@ async fn cleanup(
/// Take a scanned QR-code and do the setup-contact/join-group handshake. /// Take a scanned QR-code and do the setup-contact/join-group handshake.
/// See the ffi-documentation for more details. /// See the ffi-documentation for more details.
pub async fn dc_join_securejoin(context: &Context, qr: &str) -> ChatId { pub async fn dc_join_securejoin(context: &Context, qr: &str) -> ChatId {
if let Err(_) = context.alloc_ongoing().await { if context.alloc_ongoing().await.is_err() {
return cleanup(&context, ChatId::new(0), false, false).await; return cleanup(&context, ChatId::new(0), false, false).await;
} }
@@ -344,7 +344,7 @@ async fn send_handshake_msg(
chat::send_msg(context, contact_chat_id, &mut msg) chat::send_msg(context, contact_chat_id, &mut msg)
.await .await
.map_err(|err| HandshakeError::MsgSendFailed(err))?; .map_err(HandshakeError::MsgSendFailed)?;
Ok(()) Ok(())
} }