From af819f0fca8f9cce1aa434d0a25636ddf4dc349f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 4 Jan 2018 19:34:21 +0100 Subject: [PATCH 1/4] Remove unneeded "mut" --- lib/domain/libimaghabit/src/habit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/domain/libimaghabit/src/habit.rs b/lib/domain/libimaghabit/src/habit.rs index f98f11a0..99e1bacc 100644 --- a/lib/domain/libimaghabit/src/habit.rs +++ b/lib/domain/libimaghabit/src/habit.rs @@ -92,7 +92,7 @@ impl HabitTemplate for Entry { .map_err(From::from) .and_then(|mut entry| { { - let mut hdr = entry.get_header_mut(); + let hdr = entry.get_header_mut(); hdr.insert("habit.instance.name", Value::String(name))?; hdr.insert("habit.instance.date", Value::String(date))?; hdr.insert("habit.instance.comment", Value::String(comment))?; From e518598351f946038b4fb99f1a24de87e2939cfc Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 4 Jan 2018 19:34:43 +0100 Subject: [PATCH 2/4] Remove unneeded "mut" --- lib/entry/libimagentrygps/src/entry.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/entry/libimagentrygps/src/entry.rs b/lib/entry/libimagentrygps/src/entry.rs index 3b689fd2..5a7c2df2 100644 --- a/lib/entry/libimagentrygps/src/entry.rs +++ b/lib/entry/libimagentrygps/src/entry.rs @@ -87,7 +87,7 @@ impl GPSEntry for Entry { "gps", ]; - let mut hdr = self.get_header_mut(); + let hdr = self.get_header_mut(); for pattern in patterns.iter() { let _ = hdr.delete(pattern).chain_err(|| GPSEK::HeaderWriteError)?; } From 02f38fb209a47a19d339091fdfa99b9f407ec074 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 4 Jan 2018 19:34:55 +0100 Subject: [PATCH 3/4] Fix comments: Use two instead of three slashes --- lib/entry/libimagentrylink/src/internal.rs | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/entry/libimagentrylink/src/internal.rs b/lib/entry/libimagentrylink/src/internal.rs index d339ff8d..a03d7ac9 100644 --- a/lib/entry/libimagentrylink/src/internal.rs +++ b/lib/entry/libimagentrylink/src/internal.rs @@ -626,13 +626,13 @@ pub mod store_check { incoming: Vec, } - /// Helper function to aggregate the Link network - /// - /// This function aggregates a HashMap which maps each StoreId object in the store onto - /// a Linking object, which contains a list of StoreIds which this entry links to and a - /// list of StoreIds which link to the current one. - /// - /// The lambda returns an error if something fails + // Helper function to aggregate the Link network + // + // This function aggregates a HashMap which maps each StoreId object in the store onto + // a Linking object, which contains a list of StoreIds which this entry links to and a + // list of StoreIds which link to the current one. + // + // The lambda returns an error if something fails let aggregate_link_network = |store: &Store| -> Result> { let iter = store .entries()? @@ -669,9 +669,9 @@ pub mod store_check { Ok(map) }; - /// Helper to check whethre all StoreIds in the network actually exists - /// - /// Because why not? + // Helper to check whethre all StoreIds in the network actually exists + // + // Because why not? let all_collected_storeids_exist = |network: &HashMap| -> LResult<()> { for (id, _) in network.iter() { if is_match!(self.get(id.clone()), Ok(Some(_))) { @@ -690,14 +690,14 @@ pub mod store_check { Ok(()) }; - /// Helper function to create a SLCECD::OneDirectionalLink error object + // Helper function to create a SLCECD::OneDirectionalLink error object #[inline] let mk_one_directional_link_err = |src: StoreId, target: StoreId| -> LE { LE::from_kind(LEK::DeadLink(src, target)) }; - /// Helper lambda to check whether the _incoming_ links of each entry actually also - /// appear in the _outgoing_ list of the linked entry + // Helper lambda to check whether the _incoming_ links of each entry actually also + // appear in the _outgoing_ list of the linked entry let incoming_links_exists_as_outgoing_links = |src: &StoreId, linking: &Linking, network: &HashMap| -> Result<()> { for link in linking.incoming.iter() { @@ -715,8 +715,8 @@ pub mod store_check { Ok(()) }; - /// Helper lambda to check whether the _outgoing links of each entry actually also - /// appear in the _incoming_ list of the linked entry + // Helper lambda to check whether the _outgoing links of each entry actually also + // appear in the _incoming_ list of the linked entry let outgoing_links_exist_as_incoming_links = |src: &StoreId, linking: &Linking, network: &HashMap| -> Result<()> { for link in linking.outgoing.iter() { From 01bd02041998d01affcb8b61fcf157336bc7976a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 4 Jan 2018 19:35:35 +0100 Subject: [PATCH 4/4] Remove unused imports --- lib/etc/libimagnotification/src/lib.rs | 2 +- lib/etc/libimagnotification/src/notificator.rs | 1 - lib/etc/libimagnotification/src/result_notification.rs | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/etc/libimagnotification/src/lib.rs b/lib/etc/libimagnotification/src/lib.rs index 6e1f27f1..5999fbc4 100644 --- a/lib/etc/libimagnotification/src/lib.rs +++ b/lib/etc/libimagnotification/src/lib.rs @@ -20,7 +20,7 @@ extern crate notify_rust; #[macro_use] extern crate error_chain; -#[macro_use] extern crate libimagerror; +extern crate libimagerror; pub mod error; pub mod notificator; diff --git a/lib/etc/libimagnotification/src/notificator.rs b/lib/etc/libimagnotification/src/notificator.rs index 5772ff0d..c725b65c 100644 --- a/lib/etc/libimagnotification/src/notificator.rs +++ b/lib/etc/libimagnotification/src/notificator.rs @@ -18,7 +18,6 @@ // use error::Result; -use error::ResultExt; /// A Notificator provides a function that can be called to notify about a certain object. /// diff --git a/lib/etc/libimagnotification/src/result_notification.rs b/lib/etc/libimagnotification/src/result_notification.rs index b458f767..2f4e9ea9 100644 --- a/lib/etc/libimagnotification/src/result_notification.rs +++ b/lib/etc/libimagnotification/src/result_notification.rs @@ -105,9 +105,7 @@ pub mod ok { use notificator::default::Notification; use notificator::Notificator; - use error::NotificationErrorKind as NEK; use error::Result; - use error::ResultExt; #[derive(Debug, Default, Clone)] pub struct OkNotification(Notification);