summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-05-04 16:36:01 +0200
committerGitHub <noreply@github.com>2017-05-04 16:36:01 +0200
commit4ba19430b754d47fc673164f7db7c1e4e619eb31 (patch)
tree52cdac14833d7373c08f83903845389d6e4a0ad0
parenta5857fa64c949c9f2c9dea3036d870bd592272cc (diff)
parent8253fb9795d9ed2fe0e8267211cbf18ba6e525dc (diff)
downloadimag-4ba19430b754d47fc673164f7db7c1e4e619eb31.zip
imag-4ba19430b754d47fc673164f7db7c1e4e619eb31.tar.gz
Merge pull request #933 from matthiasbeyer/add-dep-ismatch
Add dep ismatch
-rw-r--r--libimagentrylink/Cargo.toml1
-rw-r--r--libimagentrylink/src/lib.rs3
-rw-r--r--libimagentrytag/Cargo.toml1
-rw-r--r--libimagentrytag/src/lib.rs3
-rw-r--r--libimagstore/Cargo.toml1
-rw-r--r--libimagstore/src/lib.rs3
-rw-r--r--libimagutil/src/ismatch.rs42
-rw-r--r--libimagutil/src/lib.rs1
8 files changed, 9 insertions, 46 deletions
diff --git a/libimagentrylink/Cargo.toml b/libimagentrylink/Cargo.toml
index 02d6f0a..193f510 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 ccc503f..2ed8b6b 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 81565f2..69de999 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 d8931e4..d933fb9 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 99ee6c1..4089fed 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 835704a..44fecc3 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 e47ee6b..0000000
--- 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 <mail@beyermatthias.de> 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 dc7876a..c0f7163 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;