mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 00:46:31 +03:00
Reduce the scope of clippy exceptions
This prevents creation of new overly complex functions.
This commit is contained in:
committed by
holger krekel
parent
0f52f63863
commit
1732c3b350
@@ -49,7 +49,7 @@ pub fn dc_is_configured(context: &Context) -> bool {
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Configure JOB
|
* Configure JOB
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
#[allow(non_snake_case, unused_must_use)]
|
#[allow(non_snake_case, unused_must_use, clippy::cognitive_complexity)]
|
||||||
pub fn JobConfigureImap(context: &Context) -> job::Status {
|
pub fn JobConfigureImap(context: &Context) -> job::Status {
|
||||||
if !context.sql.is_open() {
|
if !context.sql.is_open() {
|
||||||
error!(context, "Cannot configure, database not opened.",);
|
error!(context, "Cannot configure, database not opened.",);
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ pub fn dc_receive_imf(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments, clippy::cognitive_complexity)]
|
||||||
fn add_parts(
|
fn add_parts(
|
||||||
context: &Context,
|
context: &Context,
|
||||||
mut mime_parser: &mut MimeMessage,
|
mut mime_parser: &mut MimeMessage,
|
||||||
@@ -700,6 +701,7 @@ fn save_locations(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn calc_timestamps(
|
fn calc_timestamps(
|
||||||
context: &Context,
|
context: &Context,
|
||||||
chat_id: ChatId,
|
chat_id: ChatId,
|
||||||
@@ -744,7 +746,7 @@ fn calc_timestamps(
|
|||||||
/// - create an ad-hoc group based on the recipient list
|
/// - create an ad-hoc group based on the recipient list
|
||||||
///
|
///
|
||||||
/// on success the function returns the found/created (chat_id, chat_blocked) tuple .
|
/// on success the function returns the found/created (chat_id, chat_blocked) tuple .
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case, clippy::cognitive_complexity)]
|
||||||
fn create_or_lookup_group(
|
fn create_or_lookup_group(
|
||||||
context: &Context,
|
context: &Context,
|
||||||
mime_parser: &mut MimeMessage,
|
mime_parser: &mut MimeMessage,
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![deny(clippy::correctness, missing_debug_implementations, clippy::all)]
|
#![deny(clippy::correctness, missing_debug_implementations, clippy::all)]
|
||||||
// for now we hide warnings to not clutter/hide errors during "cargo clippy"
|
|
||||||
#![allow(clippy::cognitive_complexity, clippy::too_many_arguments)]
|
|
||||||
#![allow(clippy::match_bool)]
|
#![allow(clippy::match_bool)]
|
||||||
#![feature(ptr_wrapping_offset_from)]
|
#![feature(ptr_wrapping_offset_from)]
|
||||||
#![feature(drain_filter)]
|
#![feature(drain_filter)]
|
||||||
|
|||||||
@@ -576,6 +576,7 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::cognitive_complexity)]
|
||||||
fn render_message(
|
fn render_message(
|
||||||
&mut self,
|
&mut self,
|
||||||
protected_headers: &mut Vec<Header>,
|
protected_headers: &mut Vec<Header>,
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ impl<'a> MimeMessage<'a> {
|
|||||||
Ok(parser)
|
Ok(parser)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::cognitive_complexity)]
|
||||||
fn parse_headers(&mut self) -> Result<()> {
|
fn parse_headers(&mut self) -> Result<()> {
|
||||||
if self.get(HeaderDef::AutocryptSetupMessage).is_some() {
|
if self.get(HeaderDef::AutocryptSetupMessage).is_some() {
|
||||||
self.parts.drain_filter(|part| {
|
self.parts.drain_filter(|part| {
|
||||||
|
|||||||
@@ -365,6 +365,7 @@ fn table_exists(conn: &Connection, name: impl AsRef<str>) -> Result<bool> {
|
|||||||
Ok(exists)
|
Ok(exists)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::cognitive_complexity)]
|
||||||
fn open(
|
fn open(
|
||||||
context: &Context,
|
context: &Context,
|
||||||
sql: &Sql,
|
sql: &Sql,
|
||||||
|
|||||||
Reference in New Issue
Block a user