diff options
Diffstat (limited to 'lib/entry/libimagentryfilter/src/builtin/header/version/eq.rs')
-rw-r--r-- | lib/entry/libimagentryfilter/src/builtin/header/version/eq.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/entry/libimagentryfilter/src/builtin/header/version/eq.rs b/lib/entry/libimagentryfilter/src/builtin/header/version/eq.rs index 138d1da0..0a56c751 100644 --- a/lib/entry/libimagentryfilter/src/builtin/header/version/eq.rs +++ b/lib/entry/libimagentryfilter/src/builtin/header/version/eq.rs @@ -21,7 +21,7 @@ use semver::Version; use libimagstore::store::Entry; -use toml_query::read::TomlValueReadExt; +use toml_query::read::TomlValueReadTypeExt; use filters::filter::Filter; pub struct VersionEq { @@ -40,13 +40,9 @@ impl Filter<Entry> for VersionEq { fn filter(&self, e: &Entry) -> bool { e.get_header() - .read("imag.version") + .read_string("imag.version") .map(|val| { - val.map_or(false, |v| { - v.as_str() - .map(|s| Version::parse(s).map(|v| v == self.version).unwrap_or(false)) - .unwrap_or(false) - }) + val.map_or(false, |s| Version::parse(&s).map(|v| v == self.version).unwrap_or(false)) }) .unwrap_or(false) } |