summaryrefslogtreecommitdiffstats
path: root/lib/entry
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2019-08-27 10:48:33 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-08-28 18:18:40 +0200
commitf175d3db17125104b6349cd1c8986ea9913e137a (patch)
tree45be37002170eacf88503245bc56fa4f8a0b43ac /lib/entry
parent7c1a8a542c19e92d4e89eb62e54f0f47fe88f3b0 (diff)
[Auto] lib/entry/category: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'lib/entry')
-rw-r--r--lib/entry/libimagentrycategory/src/category.rs2
-rw-r--r--lib/entry/libimagentrycategory/src/entry.rs8
-rw-r--r--lib/entry/libimagentrycategory/src/iter.rs2
-rw-r--r--lib/entry/libimagentrycategory/src/store.rs6
4 files changed, 9 insertions, 9 deletions
diff --git a/lib/entry/libimagentrycategory/src/category.rs b/lib/entry/libimagentrycategory/src/category.rs
index ea2fbf90..4bc52010 100644
--- a/lib/entry/libimagentrycategory/src/category.rs
+++ b/lib/entry/libimagentrycategory/src/category.rs
@@ -52,7 +52,7 @@ impl Category for Entry {
.read_string(CATEGORY_REGISTER_NAME_FIELD_PATH)
.context(format_err!("Failed to read header at '{}'", CATEGORY_REGISTER_NAME_FIELD_PATH))
.map_err(Error::from)?
- .ok_or_else(|| Error::from(err_msg("Category name missing")))
+ .ok_or_else(|| err_msg("Category name missing"))
}
fn get_entries<'a>(&self, store: &'a Store) -> Result<CategoryEntryIterator<'a>> {
diff --git a/lib/entry/libimagentrycategory/src/entry.rs b/lib/entry/libimagentrycategory/src/entry.rs
index 9d0e06ba..8ea7a4d1 100644
--- a/lib/entry/libimagentrycategory/src/entry.rs
+++ b/lib/entry/libimagentrycategory/src/entry.rs
@@ -65,10 +65,10 @@ impl EntryCategory for Entry {
trace!("Setting category '{}' checked", s);
let mut category = register
.get_category_by_name(s)?
- .ok_or_else(|| Error::from(err_msg("Category does not exist")))?;
+ .ok_or_else(|| err_msg("Category does not exist"))?;
- let _ = self.set_category(s)?;
- let _ = self.add_link(&mut category)?;
+ self.set_category(s)?;
+ self.add_link(&mut category)?;
Ok(())
}
@@ -77,7 +77,7 @@ impl EntryCategory for Entry {
trace!("Getting category from '{}'", self.get_location());
self.get_header()
.read_string("category.value")?
- .ok_or_else(|| Error::from(err_msg("Category name missing")))
+ .ok_or_else(|| err_msg("Category name missing"))
}
fn has_category(&self) -> Result<bool> {
diff --git a/lib/entry/libimagentrycategory/src/iter.rs b/lib/entry/libimagentrycategory/src/iter.rs
index 7ed342c7..99574f6a 100644
--- a/lib/entry/libimagentrycategory/src/iter.rs
+++ b/lib/entry/libimagentrycategory/src/iter.rs
@@ -103,7 +103,7 @@ impl<'a> Iterator for CategoryEntryIterator<'a> {
let getter = |next| -> Result<(String, FileLockEntry<'a>)> {
let entry = self.0
.get(next)?
- .ok_or_else(|| Error::from(err_msg("Store read error")))?;
+ .ok_or_else(|| err_msg("Store read error"))?;
Ok((entry.get_category()?, entry))
};
diff --git a/lib/entry/libimagentrycategory/src/store.rs b/lib/entry/libimagentrycategory/src/store.rs
index 8ef44545..fa8a6c16 100644
--- a/lib/entry/libimagentrycategory/src/store.rs
+++ b/lib/entry/libimagentrycategory/src/store.rs
@@ -34,7 +34,7 @@ use failure::err_msg;
use crate::iter::CategoryNameIter;
use crate::category::IsCategory;
-pub const CATEGORY_REGISTER_NAME_FIELD_PATH : &'static str = "category.register.name";
+pub const CATEGORY_REGISTER_NAME_FIELD_PATH : &str = "category.register.name";
/// Extension on the Store to make it a register for categories
///
@@ -92,12 +92,12 @@ impl CategoryStore for Store {
{
let mut category = self.get(sid.clone())?
- .ok_or_else(|| Error::from(err_msg("Category does not exist")))
+ .ok_or_else(|| err_msg("Category does not exist"))
.map_err(Error::from)?;
for entry in category.get_entries(self)? {
let mut entry = entry?;
- let _ = category.remove_link(&mut entry)?;
+ category.remove_link(&mut entry)?;
}
}