summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2019-08-27 11:55:40 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-08-28 18:18:41 +0200
commite2216db41d78de3a22df3547812aa4c6f122bdf0 (patch)
tree704e7d37634ad300703befb10c49b955cf6cdfc4
parent0087de7af86f14d4cbb6696de7b3d38854410871 (diff)
Allow some Clippy lints
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--bin/domain/imag-contact/src/create.rs1
-rw-r--r--lib/domain/libimagbookmark/src/collection.rs2
-rw-r--r--lib/entry/libimagentrydatetime/src/datetime.rs3
-rw-r--r--lib/entry/libimagentrydatetime/src/range.rs4
-rw-r--r--lib/entry/libimagentrylink/src/linkable.rs1
5 files changed, 11 insertions, 0 deletions
diff --git a/bin/domain/imag-contact/src/create.rs b/bin/domain/imag-contact/src/create.rs
index ff8e2392..bcd87730 100644
--- a/bin/domain/imag-contact/src/create.rs
+++ b/bin/domain/imag-contact/src/create.rs
@@ -232,6 +232,7 @@ pub fn create(rt: &Runtime) {
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> {
let mut vcard = VcardBuilder::new().with_uid(uuid);
diff --git a/lib/domain/libimagbookmark/src/collection.rs b/lib/domain/libimagbookmark/src/collection.rs
index 0fc85b79..a50208ad 100644
--- a/lib/domain/libimagbookmark/src/collection.rs
+++ b/lib/domain/libimagbookmark/src/collection.rs
@@ -51,6 +51,7 @@ pub trait BookmarkCollectionStore<'a> {
impl<'a> BookmarkCollectionStore<'a> for Store {
+ #[allow(clippy::new_ret_no_self)]
fn new(&'a self, name: &str) -> Result<FileLockEntry<'a>> {
crate::module_path::new_id(name)
.and_then(|id| self.create(id)
@@ -94,6 +95,7 @@ impl BookmarkCollection for Entry {
self.get_urls(store)
}
+ #[allow(clippy::redundant_closure)]
fn link_entries(&self) -> Result<Vec<StoreLink>> {
use libimagentryurl::util::is_external_link_storeid;
self.links().map(|v| v.filter(|id| is_external_link_storeid(id)).collect())
diff --git a/lib/entry/libimagentrydatetime/src/datetime.rs b/lib/entry/libimagentrydatetime/src/datetime.rs
index 8c7555b7..46604a52 100644
--- a/lib/entry/libimagentrydatetime/src/datetime.rs
+++ b/lib/entry/libimagentrydatetime/src/datetime.rs
@@ -228,6 +228,7 @@ mod tests {
fn test_set_date() {
let store = get_store();
+ #[allow(clippy::zero_prefixed_literal)]
let date = {
let date = NaiveDate::from_ymd(2000, 01, 02);
let time = NaiveTime::from_hms(03, 04, 05);
@@ -260,6 +261,7 @@ mod tests {
}
#[test]
+ #[allow(clippy::zero_prefixed_literal)]
fn test_read_date() {
use chrono::Datelike;
use chrono::Timelike;
@@ -300,6 +302,7 @@ mod tests {
fn test_delete_date() {
let store = get_store();
+ #[allow(clippy::zero_prefixed_literal)]
let date = {
let date = NaiveDate::from_ymd(2000, 01, 02);
let time = NaiveTime::from_hms(03, 04, 05);
diff --git a/lib/entry/libimagentrydatetime/src/range.rs b/lib/entry/libimagentrydatetime/src/range.rs
index 33a77691..8c2825db 100644
--- a/lib/entry/libimagentrydatetime/src/range.rs
+++ b/lib/entry/libimagentrydatetime/src/range.rs
@@ -56,11 +56,13 @@ mod tests {
#[test]
fn test_new_returns_error_if_start_after_end_date() {
+ #[allow(clippy::zero_prefixed_literal)]
let start = NaiveDateTime::new(
NaiveDate::from_ymd(2000, 02, 02),
NaiveTime::from_hms(12, 00, 02)
);
+ #[allow(clippy::zero_prefixed_literal)]
let end = NaiveDateTime::new(
NaiveDate::from_ymd(2000, 02, 02),
NaiveTime::from_hms(12, 00, 01)
@@ -73,11 +75,13 @@ mod tests {
#[test]
fn test_new_returns_ok_if_start_is_before_end() {
+ #[allow(clippy::zero_prefixed_literal)]
let start = NaiveDateTime::new(
NaiveDate::from_ymd(2000, 02, 02),
NaiveTime::from_hms(12, 00, 01)
);
+ #[allow(clippy::zero_prefixed_literal)]
let end = NaiveDateTime::new(
NaiveDate::from_ymd(2000, 02, 02),
NaiveTime::from_hms(12, 00, 02)
diff --git a/lib/entry/libimagentrylink/src/linkable.rs b/lib/entry/libimagentrylink/src/linkable.rs
index 4cb070f5..038c8036 100644
--- a/lib/entry/libimagentrylink/src/linkable.rs
+++ b/lib/entry/libimagentrylink/src/linkable.rs
@@ -383,6 +383,7 @@ mod test {
}
#[test]
+ #[clippy::cognitive_complexity = "49"]
fn test_multiple_links() {
setup_logging();
let store = get_store();