From fe7bde38826074f461c1710ee42543681dd1eae7 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 3 Jun 2017 14:50:18 +0200 Subject: [PATCH] Minify mapping with dependency: is-match = 0.1 --- libimagrt/Cargo.toml | 1 + libimagrt/src/configuration.rs | 2 +- libimagrt/src/lib.rs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libimagrt/Cargo.toml b/libimagrt/Cargo.toml index a812e697..870b0410 100644 --- a/libimagrt/Cargo.toml +++ b/libimagrt/Cargo.toml @@ -22,6 +22,7 @@ xdg-basedir = "1.0" itertools = "0.5" tempfile = "2.1" ansi_term = "0.9" +is-match = "0.1" [dependencies.libimagstore] path = "../libimagstore" diff --git a/libimagrt/src/configuration.rs b/libimagrt/src/configuration.rs index 96d32010..38de0789 100644 --- a/libimagrt/src/configuration.rs +++ b/libimagrt/src/configuration.rs @@ -190,7 +190,7 @@ impl Deref for Configuration { fn get_verbosity(v: &Value) -> bool { match *v { Value::Table(ref t) => t.get("verbose") - .map_or(false, |v| match *v { Value::Boolean(b) => b, _ => false, }), + .map_or(false, |v| is_match!(v, &Value::Boolean(true))), _ => false, } } diff --git a/libimagrt/src/lib.rs b/libimagrt/src/lib.rs index 1670418f..63a49c45 100644 --- a/libimagrt/src/lib.rs +++ b/libimagrt/src/lib.rs @@ -42,6 +42,7 @@ extern crate ansi_term; extern crate clap; extern crate toml; +#[macro_use] extern crate is_match; extern crate libimagstore; extern crate libimagutil;