Allow some Clippy lints

Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
flip1995 2019-08-27 11:55:40 +02:00 committed by Matthias Beyer
parent 0087de7af8
commit e2216db41d
5 changed files with 11 additions and 0 deletions

View file

@ -232,6 +232,7 @@ pub fn create(rt: &Runtime) {
info!("Ready"); info!("Ready");
} }
#[clippy::cognitive_complexity = "71"]
fn parse_toml_into_vcard(output: &mut dyn Write, input: &mut dyn Read, toml: Value, uuid: String) -> Option<Vcard> { fn parse_toml_into_vcard(output: &mut dyn Write, input: &mut dyn Read, toml: Value, uuid: String) -> Option<Vcard> {
let mut vcard = VcardBuilder::new().with_uid(uuid); let mut vcard = VcardBuilder::new().with_uid(uuid);

View file

@ -51,6 +51,7 @@ pub trait BookmarkCollectionStore<'a> {
impl<'a> BookmarkCollectionStore<'a> for Store { impl<'a> BookmarkCollectionStore<'a> for Store {
#[allow(clippy::new_ret_no_self)]
fn new(&'a self, name: &str) -> Result<FileLockEntry<'a>> { fn new(&'a self, name: &str) -> Result<FileLockEntry<'a>> {
crate::module_path::new_id(name) crate::module_path::new_id(name)
.and_then(|id| self.create(id) .and_then(|id| self.create(id)
@ -94,6 +95,7 @@ impl BookmarkCollection for Entry {
self.get_urls(store) self.get_urls(store)
} }
#[allow(clippy::redundant_closure)]
fn link_entries(&self) -> Result<Vec<StoreLink>> { fn link_entries(&self) -> Result<Vec<StoreLink>> {
use libimagentryurl::util::is_external_link_storeid; use libimagentryurl::util::is_external_link_storeid;
self.links().map(|v| v.filter(|id| is_external_link_storeid(id)).collect()) self.links().map(|v| v.filter(|id| is_external_link_storeid(id)).collect())

View file

@ -228,6 +228,7 @@ mod tests {
fn test_set_date() { fn test_set_date() {
let store = get_store(); let store = get_store();
#[allow(clippy::zero_prefixed_literal)]
let date = { let date = {
let date = NaiveDate::from_ymd(2000, 01, 02); let date = NaiveDate::from_ymd(2000, 01, 02);
let time = NaiveTime::from_hms(03, 04, 05); let time = NaiveTime::from_hms(03, 04, 05);
@ -260,6 +261,7 @@ mod tests {
} }
#[test] #[test]
#[allow(clippy::zero_prefixed_literal)]
fn test_read_date() { fn test_read_date() {
use chrono::Datelike; use chrono::Datelike;
use chrono::Timelike; use chrono::Timelike;
@ -300,6 +302,7 @@ mod tests {
fn test_delete_date() { fn test_delete_date() {
let store = get_store(); let store = get_store();
#[allow(clippy::zero_prefixed_literal)]
let date = { let date = {
let date = NaiveDate::from_ymd(2000, 01, 02); let date = NaiveDate::from_ymd(2000, 01, 02);
let time = NaiveTime::from_hms(03, 04, 05); let time = NaiveTime::from_hms(03, 04, 05);

View file

@ -56,11 +56,13 @@ mod tests {
#[test] #[test]
fn test_new_returns_error_if_start_after_end_date() { fn test_new_returns_error_if_start_after_end_date() {
#[allow(clippy::zero_prefixed_literal)]
let start = NaiveDateTime::new( let start = NaiveDateTime::new(
NaiveDate::from_ymd(2000, 02, 02), NaiveDate::from_ymd(2000, 02, 02),
NaiveTime::from_hms(12, 00, 02) NaiveTime::from_hms(12, 00, 02)
); );
#[allow(clippy::zero_prefixed_literal)]
let end = NaiveDateTime::new( let end = NaiveDateTime::new(
NaiveDate::from_ymd(2000, 02, 02), NaiveDate::from_ymd(2000, 02, 02),
NaiveTime::from_hms(12, 00, 01) NaiveTime::from_hms(12, 00, 01)
@ -73,11 +75,13 @@ mod tests {
#[test] #[test]
fn test_new_returns_ok_if_start_is_before_end() { fn test_new_returns_ok_if_start_is_before_end() {
#[allow(clippy::zero_prefixed_literal)]
let start = NaiveDateTime::new( let start = NaiveDateTime::new(
NaiveDate::from_ymd(2000, 02, 02), NaiveDate::from_ymd(2000, 02, 02),
NaiveTime::from_hms(12, 00, 01) NaiveTime::from_hms(12, 00, 01)
); );
#[allow(clippy::zero_prefixed_literal)]
let end = NaiveDateTime::new( let end = NaiveDateTime::new(
NaiveDate::from_ymd(2000, 02, 02), NaiveDate::from_ymd(2000, 02, 02),
NaiveTime::from_hms(12, 00, 02) NaiveTime::from_hms(12, 00, 02)

View file

@ -383,6 +383,7 @@ mod test {
} }
#[test] #[test]
#[clippy::cognitive_complexity = "49"]
fn test_multiple_links() { fn test_multiple_links() {
setup_logging(); setup_logging();
let store = get_store(); let store = get_store();