From 3302d261744c12001ec2cd980fffd32a829185aa Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Mon, 16 Jan 2017 18:46:49 +0900 Subject: Update regex and drop proc_macro feature, its stable --- validator/Cargo.toml | 2 +- validator/src/email.rs | 4 ++-- validator_derive/src/lib.rs | 1 - validator_derive/tests/test_derive.rs | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/validator/Cargo.toml b/validator/Cargo.toml index 618c114..d622f9e 100644 --- a/validator/Cargo.toml +++ b/validator/Cargo.toml @@ -10,6 +10,6 @@ keywords = ["validation", "api", "validator"] [dependencies] url = "1.2" -regex = "0.1" +regex = "0.2" lazy_static = "0.2" idna = "0.1" diff --git a/validator/src/email.rs b/validator/src/email.rs index d7cd084..205d89f 100644 --- a/validator/src/email.rs +++ b/validator/src/email.rs @@ -49,8 +49,8 @@ fn validate_domain_part(domain_part: &str) -> bool { // maybe we have an ip as a domain? match EMAIL_LITERAL_RE.captures(domain_part) { Some(caps) => { - match caps.at(1) { - Some(c) => validate_ip(c), + match caps.get(1) { + Some(c) => validate_ip(c.as_str()), None => false, } } diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs index cdc244d..eaf82e1 100644 --- a/validator_derive/src/lib.rs +++ b/validator_derive/src/lib.rs @@ -1,4 +1,3 @@ -#![feature(proc_macro, proc_macro_lib)] #![recursion_limit = "128"] diff --git a/validator_derive/tests/test_derive.rs b/validator_derive/tests/test_derive.rs index 7cc63eb..9a11b79 100644 --- a/validator_derive/tests/test_derive.rs +++ b/validator_derive/tests/test_derive.rs @@ -1,4 +1,4 @@ -#![feature(proc_macro, attr_literals)] +#![feature(attr_literals)] #[macro_use] extern crate validator_derive; extern crate validator; -- cgit v1.2.3