diff --git a/libimagentryfilter/Cargo.toml b/libimagentryfilter/Cargo.toml index fd5562ed..43ab42a7 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 0ac821ad..7d7d0ead 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 cde39f26..95e0dde1 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 5b050f6b..656092f5 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 97655c70..de9988d9 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 32509fda..5d143889 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 e44cc389..817ec6e1 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 3506a0be..1e52fbd3 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 7b37d19e..4731a9cf 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 ff2870bf..2d405f3a 100644 --- a/libimagutil/src/key_value_split.rs +++ b/libimagutil/src/key_value_split.rs @@ -75,10 +75,12 @@ impl IntoKeyValue 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)))) + }) } }