diff --git a/libimagentrylink/Cargo.toml b/libimagentrylink/Cargo.toml index 02d6f0a7..193f5108 100644 --- a/libimagentrylink/Cargo.toml +++ b/libimagentrylink/Cargo.toml @@ -21,6 +21,7 @@ semver = "0.5" url = "1.2" rust-crypto = "0.2" env_logger = "0.3" +is-match = "0.1" [dependencies.libimagstore] path = "../libimagstore" diff --git a/libimagentrylink/src/lib.rs b/libimagentrylink/src/lib.rs index ccc503fd..2ed8b6ba 100644 --- a/libimagentrylink/src/lib.rs +++ b/libimagentrylink/src/lib.rs @@ -37,13 +37,14 @@ extern crate toml; extern crate semver; extern crate url; extern crate crypto; +#[macro_use] extern crate is_match; #[cfg(test)] extern crate env_logger; #[macro_use] extern crate libimagstore; #[macro_use] extern crate libimagerror; -#[macro_use] extern crate libimagutil; +extern crate libimagutil; module_entry_path_mod!("links"); diff --git a/libimagentrytag/Cargo.toml b/libimagentrytag/Cargo.toml index 81565f2f..69de9999 100644 --- a/libimagentrytag/Cargo.toml +++ b/libimagentrytag/Cargo.toml @@ -19,6 +19,7 @@ log = "0.3" regex = "0.2" toml = "^0.4" itertools = "0.5" +is-match = "0.1" [dependencies.libimagstore] path = "../libimagstore" diff --git a/libimagentrytag/src/lib.rs b/libimagentrytag/src/lib.rs index d8931e40..d933fb90 100644 --- a/libimagentrytag/src/lib.rs +++ b/libimagentrytag/src/lib.rs @@ -36,10 +36,11 @@ extern crate itertools; #[macro_use] extern crate log; extern crate regex; extern crate toml; +#[macro_use] extern crate is_match; extern crate libimagstore; #[macro_use] extern crate libimagerror; -#[macro_use] extern crate libimagutil; +extern crate libimagutil; pub mod error; pub mod exec; diff --git a/libimagstore/Cargo.toml b/libimagstore/Cargo.toml index 99ee6c1a..4089feda 100644 --- a/libimagstore/Cargo.toml +++ b/libimagstore/Cargo.toml @@ -25,6 +25,7 @@ version = "2.0.1" crossbeam = "0.2.*" walkdir = "1.0.*" itertools = "0.6.*" +is-match = "0.1" [dependencies.libimagerror] path = "../libimagerror" diff --git a/libimagstore/src/lib.rs b/libimagstore/src/lib.rs index 835704a3..44fecc36 100644 --- a/libimagstore/src/lib.rs +++ b/libimagstore/src/lib.rs @@ -43,9 +43,10 @@ extern crate semver; extern crate crossbeam; extern crate walkdir; extern crate itertools; +#[macro_use] extern crate is_match; #[macro_use] extern crate libimagerror; -#[macro_use] extern crate libimagutil; +extern crate libimagutil; #[macro_use] mod util; diff --git a/libimagutil/src/ismatch.rs b/libimagutil/src/ismatch.rs deleted file mode 100644 index e47ee6bf..00000000 --- a/libimagutil/src/ismatch.rs +++ /dev/null @@ -1,42 +0,0 @@ -// -// imag - the personal information management suite for the commandline -// Copyright (C) 2015, 2016 Matthias Beyer and contributors -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; version -// 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -// - -#[macro_export] -macro_rules! is_match { - ($expression: expr, $($pattern:tt)+) => { - is_match! {tt - match $expression { - $($pattern)+ => true, - _ => false - } - } - }; - (tt $value:expr) => ($value); -} - -#[test] -fn test_matching() { - let foo = Some("-12"); - assert!(is_match!(foo, Some(bar) if - is_match!(bar.as_bytes()[0], b'+' | b'-') && - is_match!(bar.as_bytes()[1], b'0'...b'9') - )); - assert!(!is_match!(foo, None)); -} - diff --git a/libimagutil/src/lib.rs b/libimagutil/src/lib.rs index dc7876ad..c0f71636 100644 --- a/libimagutil/src/lib.rs +++ b/libimagutil/src/lib.rs @@ -44,7 +44,6 @@ pub mod cli_validators; pub mod debug_result; pub mod edit; pub mod info_result; -pub mod ismatch; pub mod iter; pub mod key_value_split; pub mod variants;