Remove unecessary String instantiation

This commit is contained in:
Matthias Beyer 2018-01-21 21:47:56 +01:00
parent 2c133de5bc
commit 4bd156fdb3

View file

@ -266,7 +266,7 @@ impl<'a> Iterator for CategoryNameIter<'a> {
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
// TODO: Optimize me with lazy_static // TODO: Optimize me with lazy_static
let query = String::from(CATEGORY_REGISTER_NAME_FIELD_PATH); let query = CATEGORY_REGISTER_NAME_FIELD_PATH;
self.1 self.1
.next() .next()
@ -275,7 +275,7 @@ impl<'a> Iterator for CategoryNameIter<'a> {
.get(sid)? .get(sid)?
.ok_or_else(|| CE::from_kind(CEK::StoreReadError))? .ok_or_else(|| CE::from_kind(CEK::StoreReadError))?
.get_header() .get_header()
.read_string(&query) .read_string(query)
.chain_err(|| CEK::HeaderReadError)? .chain_err(|| CEK::HeaderReadError)?
.map(Category::from) .map(Category::from)
.ok_or_else(|| CE::from_kind(CEK::StoreReadError)) .ok_or_else(|| CE::from_kind(CEK::StoreReadError))