From 638b0d8af2a9dcbae81afd2bcf20148946cf61e2 Mon Sep 17 00:00:00 2001 From: fengcen Date: Thu, 17 Nov 2016 00:28:54 +0800 Subject: [PATCH] update document link. rename error. --- Cargo.toml | 4 ++-- src/error/mod.rs | 6 +++--- src/expression/mod.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f986261..721204f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "eval" -version = "0.1.0" +version = "0.1.1" description = "Expression evaluator" keywords = ["expression", "evaluate", "evaluator", "expr"] authors = ["fengcen "] repository = "https://github.com/fengcen/eval.git" homepage = "https://github.com/fengcen/eval" -documentation = "https://github.com/fengcen/eval" +documentation = "https://docs.rs/eval" readme = "README.md" license = "MIT" diff --git a/src/error/mod.rs b/src/error/mod.rs index 733e364..86d0f8f 100644 --- a/src/error/mod.rs +++ b/src/error/mod.rs @@ -63,9 +63,9 @@ quick_error! { UnsupportedTypes(a: String, b: String) { display("This two value types are different or do not support mathematical calculations: {}, {}", a, b) } - /// Invalid array expression like `1..2..3` - InvalidArray(ident: String) { - display("Invalid array expression: {}", ident) + /// Invalid range expression like `1..2..3` + InvalidRange(ident: String) { + display("Invalid range expression: {}", ident) } /// Custom error. Custom(detail: String) { diff --git a/src/expression/mod.rs b/src/expression/mod.rs index 4788886..922b8ef 100644 --- a/src/expression/mod.rs +++ b/src/expression/mod.rs @@ -472,7 +472,7 @@ fn is_range(ident: &str) -> bool { fn parse_range(ident: &str) -> Result { let segments = ident.split("..").collect::>(); if segments.len() != 2 { - Err(Error::InvalidArray(ident.to_owned())) + Err(Error::InvalidRange(ident.to_owned())) } else { let start = segments[0].parse::(); let end = segments[1].parse::(); @@ -484,7 +484,7 @@ fn parse_range(ident: &str) -> Result { } Ok(to_value(array)) } else { - Err(Error::InvalidArray(ident.to_owned())) + Err(Error::InvalidRange(ident.to_owned())) } } }