summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-01-30 12:09:37 +0100
committerGitHub <noreply@github.com>2017-01-30 12:09:37 +0100
commit3c7edcfb501d1f88df4a5e1d47c8bc1ac441cb20 (patch)
tree3ba973cb2024051894bc7a147493114d135ebd06
parentdf0fa438c578bcf51ada250aea7eda7aed5ded89 (diff)
parent6373bd1db99e0b7f3630df81e9e481b1ad2e538a (diff)
downloadimag-3c7edcfb501d1f88df4a5e1d47c8bc1ac441cb20.zip
imag-3c7edcfb501d1f88df4a5e1d47c8bc1ac441cb20.tar.gz
Merge pull request #878 from matthiasbeyer/update-regex
Update regex to 0.2.*
-rw-r--r--libimagentryfilter/Cargo.toml2
-rw-r--r--libimagentrytag/Cargo.toml2
-rw-r--r--libimaginteraction/Cargo.toml2
-rw-r--r--libimagstore/Cargo.toml2
-rw-r--r--libimagstore/src/store.rs6
-rw-r--r--libimagtimeui/Cargo.toml2
-rw-r--r--libimagtimeui/src/date.rs6
-rw-r--r--libimagtimeui/src/time.rs15
-rw-r--r--libimagutil/Cargo.toml2
-rw-r--r--libimagutil/src/key_value_split.rs6
10 files changed, 28 insertions, 17 deletions
diff --git a/libimagentryfilter/Cargo.toml b/libimagentryfilter/Cargo.toml
index fd5562e..43ab42a 100644
--- a/libimagentryfilter/Cargo.toml
+++ b/libimagentryfilter/Cargo.toml
@@ -18,7 +18,7 @@ clap = ">=2.17"
filters = "0.1.*"
itertools = "0.5"
log = "0.3"
-regex = "0.1"
+regex = "0.2"
semver = "0.5.*"
toml = "0.2.*"
diff --git a/libimagentrytag/Cargo.toml b/libimagentrytag/Cargo.toml
index 0ac821a..7d7d0ea 100644
--- a/libimagentrytag/Cargo.toml
+++ b/libimagentrytag/Cargo.toml
@@ -16,7 +16,7 @@ homepage = "http://imag-pim.org"
[dependencies]
clap = ">=2.17"
log = "0.3"
-regex = "0.1"
+regex = "0.2"
toml = "0.2.*"
itertools = "0.5"
diff --git a/libimaginteraction/Cargo.toml b/libimaginteraction/Cargo.toml
index cde39f2..95e0dde 100644
--- a/libimaginteraction/Cargo.toml
+++ b/libimaginteraction/Cargo.toml
@@ -19,7 +19,7 @@ clap = ">=2.17"
interactor = "0.1"
lazy_static = "0.2.*"
log = "0.3"
-regex = "0.1"
+regex = "0.2"
toml = "0.2.1"
spinner = "0.4"
rustyline = "1.0"
diff --git a/libimagstore/Cargo.toml b/libimagstore/Cargo.toml
index 5b050f6..656092f 100644
--- a/libimagstore/Cargo.toml
+++ b/libimagstore/Cargo.toml
@@ -18,7 +18,7 @@ fs2 = "0.4"
glob = "0.2.11"
lazy_static = "0.2.*"
log = "0.3"
-regex = "0.1"
+regex = "0.2"
semver = "0.5"
toml = "0.2.*"
version = "2.0.1"
diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs
index 97655c7..de9988d 100644
--- a/libimagstore/src/store.rs
+++ b/libimagstore/src/store.rs
@@ -1182,13 +1182,13 @@ impl Entry {
Some(s) => s
};
- let content = matches.name("content").unwrap_or("");
+ let content = matches.name("content").map(|r| r.as_str()).unwrap_or("");
debug!("Header and content found. Yay! Building Entry object now");
Ok(Entry {
location: try!(loc.into_storeid()),
- header: try!(EntryHeader::parse(header)),
- content: content.into(),
+ header: try!(EntryHeader::parse(header.as_str())),
+ content: String::from(content),
})
}
diff --git a/libimagtimeui/Cargo.toml b/libimagtimeui/Cargo.toml
index 32509fd..5d14388 100644
--- a/libimagtimeui/Cargo.toml
+++ b/libimagtimeui/Cargo.toml
@@ -18,7 +18,7 @@ clap = ">=2.17"
lazy_static = "0.2"
log = "0.3"
chrono = "0.2"
-regex = "0.1"
+regex = "0.2"
[dependencies.libimagerror]
path = "../libimagerror"
diff --git a/libimagtimeui/src/date.rs b/libimagtimeui/src/date.rs
index e44cc38..817ec6e 100644
--- a/libimagtimeui/src/date.rs
+++ b/libimagtimeui/src/date.rs
@@ -73,9 +73,9 @@ impl Parse for Date {
R.captures(s)
.and_then(|capts| {
- let year = capts.name("Y").and_then(|o| FromStr::from_str(o).ok());
- let month = capts.name("M").and_then(|o| FromStr::from_str(o).ok());
- let day = capts.name("D").and_then(|o| FromStr::from_str(o).ok());
+ let year = capts.name("Y").and_then(|o| FromStr::from_str(o.as_str()).ok());
+ let month = capts.name("M").and_then(|o| FromStr::from_str(o.as_str()).ok());
+ let day = capts.name("D").and_then(|o| FromStr::from_str(o.as_str()).ok());
let year = match year {
None => {
diff --git a/libimagtimeui/src/time.rs b/libimagtimeui/src/time.rs
index 3506a0b..1e52fbd 100644
--- a/libimagtimeui/src/time.rs
+++ b/libimagtimeui/src/time.rs
@@ -72,9 +72,18 @@ impl Parse for Time {
R.captures(s)
.and_then(|capts| {
- let minute = capts.name("m").and_then(|o| FromStr::from_str(o).ok()).unwrap_or(0);
- let second = capts.name("s").and_then(|o| FromStr::from_str(o).ok()).unwrap_or(0);
- let hour = match capts.name("h").and_then(|o| FromStr::from_str(o).ok()) {
+ let minute = capts
+ .name("m")
+ .and_then(|o| FromStr::from_str(o.as_str()).ok())
+ .unwrap_or(0);
+ let second = capts
+ .name("s")
+ .and_then(|o| FromStr::from_str(o.as_str()).ok())
+ .unwrap_or(0);
+ let hour = match capts
+ .name("h")
+ .and_then(|o| FromStr::from_str(o.as_str()).ok())
+ {
None => {
debug!("No hour");
return None;
diff --git a/libimagutil/Cargo.toml b/libimagutil/Cargo.toml
index 7b37d19..4731a9c 100644
--- a/libimagutil/Cargo.toml
+++ b/libimagutil/Cargo.toml
@@ -18,6 +18,6 @@ url = "1.2"
boolinator = "2.4.0"
lazy_static = "0.2"
log = "0.3"
-regex = "0.1"
+regex = "0.2"
tempfile = "2.1"
diff --git a/libimagutil/src/key_value_split.rs b/libimagutil/src/key_value_split.rs
index ff2870b..2d405f3 100644
--- a/libimagutil/src/key_value_split.rs
+++ b/libimagutil/src/key_value_split.rs
@@ -75,10 +75,12 @@ impl IntoKeyValue<String, String> for String {
.unwrap();
}
R.captures(&self[..])
- .map(|caps| caps.name("VALUE").or(caps.name("QVALUE")).unwrap_or(""))
+ .map(|c| c.name("VALUE").or(c.name("QVALUE")).map(|m| m.as_str()).unwrap_or(""))
};
- key.and_then(|k| value.and_then(|v| Some(KeyValue::new(String::from(k), String::from(v)))))
+ key.and_then(|k| {
+ value.and_then(|v| Some(KeyValue::new(String::from(k.as_str()), String::from(v))))
+ })
}
}