diff --git a/Cargo.toml b/Cargo.toml index 5dfdcf7..39b2d15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ homepage = "https://github.com/ISibboI/evalexpr" documentation = "https://docs.rs/evalexpr" readme = "README.md" license = "MIT" +edition = "2018" [lib] name = "evalexpr" diff --git a/src/context/mod.rs b/src/context/mod.rs index 3161027..092d064 100644 --- a/src/context/mod.rs +++ b/src/context/mod.rs @@ -1,9 +1,9 @@ use std::collections::HashMap; -use function::Function; -use value::value_type::ValueType; -use EvalexprError; -use EvalexprResult; +use crate::function::Function; +use crate::value::value_type::ValueType; +use crate::EvalexprError; +use crate::EvalexprResult; use crate::value::Value; diff --git a/src/error/display.rs b/src/error/display.rs index 8b15a49..c583a36 100644 --- a/src/error/display.rs +++ b/src/error/display.rs @@ -1,10 +1,10 @@ use std::fmt; -use EvalexprError; +use crate::EvalexprError; impl fmt::Display for EvalexprError { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { - use EvalexprError::*; + use crate::EvalexprError::*; match self { WrongOperatorArgumentAmount { expected, actual } => write!( f, diff --git a/src/error/mod.rs b/src/error/mod.rs index a053371..0066602 100644 --- a/src/error/mod.rs +++ b/src/error/mod.rs @@ -5,8 +5,8 @@ //! The module also contains some helper functions starting with `expect_` that check for a condition and return `Err(_)` if the condition is not fulfilled. //! They are meant as shortcuts to not write the same error checking code everywhere. -use token::PartialToken; -use value::{value_type::ValueType, TupleType}; +use crate::token::PartialToken; +use crate::value::{value_type::ValueType, TupleType}; use crate::value::Value; diff --git a/src/function/builtin.rs b/src/function/builtin.rs index 0d46512..699d9ad 100644 --- a/src/function/builtin.rs +++ b/src/function/builtin.rs @@ -2,10 +2,10 @@ use regex::Regex; use crate::error::*; -use value::{FloatType, IntType}; -use EvalexprError; -use Function; -use Value; +use crate::value::{FloatType, IntType}; +use crate::EvalexprError; +use crate::Function; +use crate::Value; pub fn builtin_function(identifier: &str) -> Option { match identifier { diff --git a/src/function/mod.rs b/src/function/mod.rs index 0f9ad9f..bd5b290 100644 --- a/src/function/mod.rs +++ b/src/function/mod.rs @@ -1,7 +1,7 @@ use std::fmt; -use error::EvalexprResult; -use value::Value; +use crate::error::EvalexprResult; +use crate::value::Value; pub(crate) mod builtin; @@ -20,14 +20,14 @@ pub(crate) mod builtin; /// assert_eq!(eval_with_context("id(4)", &context), Ok(Value::from(4))); /// ``` pub struct Function { - function: Box EvalexprResult>, + function: Box EvalexprResult>, } impl Function { /// Creates a user-defined function. /// /// The `function` is a boxed function that takes a `Value` and returns a `EvalexprResult`. - pub fn new(function: Box EvalexprResult>) -> Self { + pub fn new(function: Box EvalexprResult>) -> Self { Self { function } } diff --git a/src/interface/mod.rs b/src/interface/mod.rs index d6fa5e8..2e59209 100644 --- a/src/interface/mod.rs +++ b/src/interface/mod.rs @@ -1,16 +1,16 @@ -use token; -use tree; -use value::TupleType; -use Context; -use EmptyContext; -use EmptyType; -use EvalexprError; -use EvalexprResult; -use FloatType; -use IntType; -use Node; -use Value; -use EMPTY_VALUE; +use crate::token; +use crate::tree; +use crate::value::TupleType; +use crate::Context; +use crate::EmptyContext; +use crate::EmptyType; +use crate::EvalexprError; +use crate::EvalexprResult; +use crate::FloatType; +use crate::IntType; +use crate::Node; +use crate::Value; +use crate::EMPTY_VALUE; /// Evaluate the given expression string. /// @@ -42,7 +42,7 @@ pub fn eval(string: &str) -> EvalexprResult { /// ``` /// /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* -pub fn eval_with_context(string: &str, context: &Context) -> EvalexprResult { +pub fn eval_with_context(string: &str, context: &dyn Context) -> EvalexprResult { tree::tokens_to_operator_tree(token::tokenize(string)?)?.eval_with_context(context) } @@ -61,7 +61,7 @@ pub fn eval_with_context(string: &str, context: &Context) -> EvalexprResult EvalexprResult { +pub fn eval_with_context_mut(string: &str, context: &mut dyn Context) -> EvalexprResult { tree::tokens_to_operator_tree(token::tokenize(string)?)?.eval_with_context_mut(context) } @@ -146,7 +146,7 @@ pub fn eval_empty(string: &str) -> EvalexprResult { /// Evaluate the given expression string into a string with the given context. /// /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* -pub fn eval_string_with_context(string: &str, context: &Context) -> EvalexprResult { +pub fn eval_string_with_context(string: &str, context: &dyn Context) -> EvalexprResult { match eval_with_context(string, context) { Ok(Value::String(string)) => Ok(string), Ok(value) => Err(EvalexprError::expected_string(value)), @@ -157,7 +157,7 @@ pub fn eval_string_with_context(string: &str, context: &Context) -> EvalexprResu /// Evaluate the given expression string into an integer with the given context. /// /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* -pub fn eval_int_with_context(string: &str, context: &Context) -> EvalexprResult { +pub fn eval_int_with_context(string: &str, context: &dyn Context) -> EvalexprResult { match eval_with_context(string, context) { Ok(Value::Int(int)) => Ok(int), Ok(value) => Err(EvalexprError::expected_int(value)), @@ -168,7 +168,7 @@ pub fn eval_int_with_context(string: &str, context: &Context) -> EvalexprResult< /// Evaluate the given expression string into a float with the given context. /// /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* -pub fn eval_float_with_context(string: &str, context: &Context) -> EvalexprResult { +pub fn eval_float_with_context(string: &str, context: &dyn Context) -> EvalexprResult { match eval_with_context(string, context) { Ok(Value::Float(float)) => Ok(float), Ok(value) => Err(EvalexprError::expected_float(value)), @@ -180,7 +180,7 @@ pub fn eval_float_with_context(string: &str, context: &Context) -> EvalexprResul /// If the result of the expression is an integer, it is silently converted into a float. /// /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* -pub fn eval_number_with_context(string: &str, context: &Context) -> EvalexprResult { +pub fn eval_number_with_context(string: &str, context: &dyn Context) -> EvalexprResult { match eval_with_context(string, context) { Ok(Value::Float(float)) => Ok(float), Ok(Value::Int(int)) => Ok(int as FloatType), @@ -192,7 +192,7 @@ pub fn eval_number_with_context(string: &str, context: &Context) -> EvalexprResu /// Evaluate the given expression string into a boolean with the given context. /// /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* -pub fn eval_boolean_with_context(string: &str, context: &Context) -> EvalexprResult { +pub fn eval_boolean_with_context(string: &str, context: &dyn Context) -> EvalexprResult { match eval_with_context(string, context) { Ok(Value::Boolean(boolean)) => Ok(boolean), Ok(value) => Err(EvalexprError::expected_boolean(value)), @@ -203,7 +203,7 @@ pub fn eval_boolean_with_context(string: &str, context: &Context) -> EvalexprRes /// Evaluate the given expression string into a tuple with the given context. /// /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* -pub fn eval_tuple_with_context(string: &str, context: &Context) -> EvalexprResult { +pub fn eval_tuple_with_context(string: &str, context: &dyn Context) -> EvalexprResult { match eval_with_context(string, context) { Ok(Value::Tuple(tuple)) => Ok(tuple), Ok(value) => Err(EvalexprError::expected_tuple(value)), @@ -214,7 +214,7 @@ pub fn eval_tuple_with_context(string: &str, context: &Context) -> EvalexprResul /// Evaluate the given expression string into an empty value with the given context. /// /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* -pub fn eval_empty_with_context(string: &str, context: &Context) -> EvalexprResult { +pub fn eval_empty_with_context(string: &str, context: &dyn Context) -> EvalexprResult { match eval_with_context(string, context) { Ok(Value::Empty) => Ok(EMPTY_VALUE), Ok(value) => Err(EvalexprError::expected_empty(value)), @@ -225,7 +225,7 @@ pub fn eval_empty_with_context(string: &str, context: &Context) -> EvalexprResul /// Evaluate the given expression string into a string with the given mutable context. /// /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* -pub fn eval_string_with_context_mut(string: &str, context: &mut Context) -> EvalexprResult { +pub fn eval_string_with_context_mut(string: &str, context: &mut dyn Context) -> EvalexprResult { match eval_with_context_mut(string, context) { Ok(Value::String(string)) => Ok(string), Ok(value) => Err(EvalexprError::expected_string(value)), @@ -236,7 +236,7 @@ pub fn eval_string_with_context_mut(string: &str, context: &mut Context) -> Eval /// Evaluate the given expression string into an integer with the given mutable context. /// /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* -pub fn eval_int_with_context_mut(string: &str, context: &mut Context) -> EvalexprResult { +pub fn eval_int_with_context_mut(string: &str, context: &mut dyn Context) -> EvalexprResult { match eval_with_context_mut(string, context) { Ok(Value::Int(int)) => Ok(int), Ok(value) => Err(EvalexprError::expected_int(value)), @@ -249,7 +249,7 @@ pub fn eval_int_with_context_mut(string: &str, context: &mut Context) -> Evalexp /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* pub fn eval_float_with_context_mut( string: &str, - context: &mut Context, + context: &mut dyn Context, ) -> EvalexprResult { match eval_with_context_mut(string, context) { Ok(Value::Float(float)) => Ok(float), @@ -264,7 +264,7 @@ pub fn eval_float_with_context_mut( /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* pub fn eval_number_with_context_mut( string: &str, - context: &mut Context, + context: &mut dyn Context, ) -> EvalexprResult { match eval_with_context_mut(string, context) { Ok(Value::Float(float)) => Ok(float), @@ -277,7 +277,7 @@ pub fn eval_number_with_context_mut( /// Evaluate the given expression string into a boolean with the given mutable context. /// /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* -pub fn eval_boolean_with_context_mut(string: &str, context: &mut Context) -> EvalexprResult { +pub fn eval_boolean_with_context_mut(string: &str, context: &mut dyn Context) -> EvalexprResult { match eval_with_context_mut(string, context) { Ok(Value::Boolean(boolean)) => Ok(boolean), Ok(value) => Err(EvalexprError::expected_boolean(value)), @@ -290,7 +290,7 @@ pub fn eval_boolean_with_context_mut(string: &str, context: &mut Context) -> Eva /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* pub fn eval_tuple_with_context_mut( string: &str, - context: &mut Context, + context: &mut dyn Context, ) -> EvalexprResult { match eval_with_context_mut(string, context) { Ok(Value::Tuple(tuple)) => Ok(tuple), @@ -304,7 +304,7 @@ pub fn eval_tuple_with_context_mut( /// *See the [crate doc](index.html) for more examples and explanations of the expression format.* pub fn eval_empty_with_context_mut( string: &str, - context: &mut Context, + context: &mut dyn Context, ) -> EvalexprResult { match eval_with_context_mut(string, context) { Ok(Value::Empty) => Ok(EMPTY_VALUE), diff --git a/src/lib.rs b/src/lib.rs index 88a0155..2fd78b3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -372,12 +372,12 @@ extern crate serde; #[macro_use] extern crate serde_derive; -pub use context::{Context, EmptyContext, HashMapContext}; -pub use error::{EvalexprError, EvalexprResult}; -pub use function::Function; -pub use interface::*; -pub use tree::Node; -pub use value::{ +pub use crate::context::{Context, EmptyContext, HashMapContext}; +pub use crate::error::{EvalexprError, EvalexprResult}; +pub use crate::function::Function; +pub use crate::interface::*; +pub use crate::tree::Node; +pub use crate::value::{ value_type::ValueType, EmptyType, FloatType, IntType, TupleType, Value, EMPTY_VALUE, }; diff --git a/src/operator/display.rs b/src/operator/display.rs index b713b20..96b0987 100644 --- a/src/operator/display.rs +++ b/src/operator/display.rs @@ -1,6 +1,6 @@ use std::fmt::{Display, Error, Formatter}; -use operator::*; +use crate::operator::*; impl Display for Operator { fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { diff --git a/src/operator/mod.rs b/src/operator/mod.rs index a8ddda6..56862dc 100644 --- a/src/operator/mod.rs +++ b/src/operator/mod.rs @@ -1,4 +1,4 @@ -use function::builtin::builtin_function; +use crate::function::builtin::builtin_function; use crate::{context::Context, error::*, value::Value}; diff --git a/src/token/display.rs b/src/token/display.rs index f696e6c..ed8126e 100644 --- a/src/token/display.rs +++ b/src/token/display.rs @@ -1,6 +1,6 @@ use std::fmt; -use token::{PartialToken, Token}; +use crate::token::{PartialToken, Token}; impl fmt::Display for Token { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { diff --git a/src/token/mod.rs b/src/token/mod.rs index d3a3fe4..66662dc 100644 --- a/src/token/mod.rs +++ b/src/token/mod.rs @@ -1,5 +1,5 @@ -use error::{EvalexprError, EvalexprResult}; -use value::{FloatType, IntType}; +use crate::error::{EvalexprError, EvalexprResult}; +use crate::value::{FloatType, IntType}; mod display; diff --git a/src/tree/display.rs b/src/tree/display.rs index 1460187..6b7152a 100644 --- a/src/tree/display.rs +++ b/src/tree/display.rs @@ -1,5 +1,5 @@ use std::fmt::{Display, Error, Formatter}; -use Node; +use crate::Node; impl Display for Node { fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { diff --git a/src/tree/iter.rs b/src/tree/iter.rs index f2481e1..6648005 100644 --- a/src/tree/iter.rs +++ b/src/tree/iter.rs @@ -1,5 +1,5 @@ use std::slice::Iter; -use Node; +use crate::Node; /// An iterator that traverses an operator tree in pre-order. pub struct NodeIter<'a> { diff --git a/src/tree/mod.rs b/src/tree/mod.rs index 9ae775b..6724ad8 100644 --- a/src/tree/mod.rs +++ b/src/tree/mod.rs @@ -1,9 +1,9 @@ -use token::Token; -use value::{TupleType, EMPTY_VALUE}; -use EmptyContext; -use EmptyType; -use FloatType; -use IntType; +use crate::token::Token; +use crate::value::{TupleType, EMPTY_VALUE}; +use crate::EmptyContext; +use crate::EmptyType; +use crate::FloatType; +use crate::IntType; use crate::{ context::Context, @@ -120,7 +120,7 @@ impl Node { /// Evaluates the operator tree rooted at this node with the given context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_with_context(&self, context: &Context) -> EvalexprResult { + pub fn eval_with_context(&self, context: &dyn Context) -> EvalexprResult { let mut arguments = Vec::new(); for child in self.children() { arguments.push(child.eval_with_context(context)?); @@ -131,7 +131,7 @@ impl Node { /// Evaluates the operator tree rooted at this node with the given mutable context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_with_context_mut(&self, context: &mut Context) -> EvalexprResult { + pub fn eval_with_context_mut(&self, context: &mut dyn Context) -> EvalexprResult { let mut arguments = Vec::new(); for child in self.children() { arguments.push(child.eval_with_context_mut(context)?); @@ -149,7 +149,7 @@ impl Node { /// Evaluates the operator tree rooted at this node into a string with an the given context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_string_with_context(&self, context: &Context) -> EvalexprResult { + pub fn eval_string_with_context(&self, context: &dyn Context) -> EvalexprResult { match self.eval_with_context(context) { Ok(Value::String(string)) => Ok(string), Ok(value) => Err(EvalexprError::expected_string(value)), @@ -160,7 +160,7 @@ impl Node { /// Evaluates the operator tree rooted at this node into a float with an the given context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_float_with_context(&self, context: &Context) -> EvalexprResult { + pub fn eval_float_with_context(&self, context: &dyn Context) -> EvalexprResult { match self.eval_with_context(context) { Ok(Value::Float(float)) => Ok(float), Ok(value) => Err(EvalexprError::expected_float(value)), @@ -171,7 +171,7 @@ impl Node { /// Evaluates the operator tree rooted at this node into an integer with an the given context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_int_with_context(&self, context: &Context) -> EvalexprResult { + pub fn eval_int_with_context(&self, context: &dyn Context) -> EvalexprResult { match self.eval_with_context(context) { Ok(Value::Int(int)) => Ok(int), Ok(value) => Err(EvalexprError::expected_int(value)), @@ -183,7 +183,7 @@ impl Node { /// If the result of the expression is an integer, it is silently converted into a float. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_number_with_context(&self, context: &Context) -> EvalexprResult { + pub fn eval_number_with_context(&self, context: &dyn Context) -> EvalexprResult { match self.eval_with_context(context) { Ok(Value::Int(int)) => Ok(int as FloatType), Ok(Value::Float(float)) => Ok(float), @@ -195,7 +195,7 @@ impl Node { /// Evaluates the operator tree rooted at this node into a boolean with an the given context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_boolean_with_context(&self, context: &Context) -> EvalexprResult { + pub fn eval_boolean_with_context(&self, context: &dyn Context) -> EvalexprResult { match self.eval_with_context(context) { Ok(Value::Boolean(boolean)) => Ok(boolean), Ok(value) => Err(EvalexprError::expected_boolean(value)), @@ -206,7 +206,7 @@ impl Node { /// Evaluates the operator tree rooted at this node into a tuple with an the given context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_tuple_with_context(&self, context: &Context) -> EvalexprResult { + pub fn eval_tuple_with_context(&self, context: &dyn Context) -> EvalexprResult { match self.eval_with_context(context) { Ok(Value::Tuple(tuple)) => Ok(tuple), Ok(value) => Err(EvalexprError::expected_tuple(value)), @@ -217,7 +217,7 @@ impl Node { /// Evaluates the operator tree rooted at this node into an empty value with an the given context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_empty_with_context(&self, context: &Context) -> EvalexprResult { + pub fn eval_empty_with_context(&self, context: &dyn Context) -> EvalexprResult { match self.eval_with_context(context) { Ok(Value::Empty) => Ok(EMPTY_VALUE), Ok(value) => Err(EvalexprError::expected_empty(value)), @@ -228,7 +228,7 @@ impl Node { /// Evaluates the operator tree rooted at this node into a string with an the given mutable context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_string_with_context_mut(&self, context: &mut Context) -> EvalexprResult { + pub fn eval_string_with_context_mut(&self, context: &mut dyn Context) -> EvalexprResult { match self.eval_with_context_mut(context) { Ok(Value::String(string)) => Ok(string), Ok(value) => Err(EvalexprError::expected_string(value)), @@ -239,7 +239,7 @@ impl Node { /// Evaluates the operator tree rooted at this node into a float with an the given mutable context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_float_with_context_mut(&self, context: &mut Context) -> EvalexprResult { + pub fn eval_float_with_context_mut(&self, context: &mut dyn Context) -> EvalexprResult { match self.eval_with_context_mut(context) { Ok(Value::Float(float)) => Ok(float), Ok(value) => Err(EvalexprError::expected_float(value)), @@ -250,7 +250,7 @@ impl Node { /// Evaluates the operator tree rooted at this node into an integer with an the given mutable context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_int_with_context_mut(&self, context: &mut Context) -> EvalexprResult { + pub fn eval_int_with_context_mut(&self, context: &mut dyn Context) -> EvalexprResult { match self.eval_with_context_mut(context) { Ok(Value::Int(int)) => Ok(int), Ok(value) => Err(EvalexprError::expected_int(value)), @@ -262,7 +262,7 @@ impl Node { /// If the result of the expression is an integer, it is silently converted into a float. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_number_with_context_mut(&self, context: &mut Context) -> EvalexprResult { + pub fn eval_number_with_context_mut(&self, context: &mut dyn Context) -> EvalexprResult { match self.eval_with_context_mut(context) { Ok(Value::Int(int)) => Ok(int as FloatType), Ok(Value::Float(float)) => Ok(float), @@ -274,7 +274,7 @@ impl Node { /// Evaluates the operator tree rooted at this node into a boolean with an the given mutable context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_boolean_with_context_mut(&self, context: &mut Context) -> EvalexprResult { + pub fn eval_boolean_with_context_mut(&self, context: &mut dyn Context) -> EvalexprResult { match self.eval_with_context_mut(context) { Ok(Value::Boolean(boolean)) => Ok(boolean), Ok(value) => Err(EvalexprError::expected_boolean(value)), @@ -285,7 +285,7 @@ impl Node { /// Evaluates the operator tree rooted at this node into a tuple with an the given mutable context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_tuple_with_context_mut(&self, context: &mut Context) -> EvalexprResult { + pub fn eval_tuple_with_context_mut(&self, context: &mut dyn Context) -> EvalexprResult { match self.eval_with_context_mut(context) { Ok(Value::Tuple(tuple)) => Ok(tuple), Ok(value) => Err(EvalexprError::expected_tuple(value)), @@ -296,7 +296,7 @@ impl Node { /// Evaluates the operator tree rooted at this node into an empty value with an the given mutable context. /// /// Fails, if one of the operators in the expression tree fails. - pub fn eval_empty_with_context_mut(&self, context: &mut Context) -> EvalexprResult { + pub fn eval_empty_with_context_mut(&self, context: &mut dyn Context) -> EvalexprResult { match self.eval_with_context_mut(context) { Ok(Value::Empty) => Ok(EMPTY_VALUE), Ok(value) => Err(EvalexprError::expected_empty(value)), diff --git a/src/value/display.rs b/src/value/display.rs index 4e98d39..599baa4 100644 --- a/src/value/display.rs +++ b/src/value/display.rs @@ -1,6 +1,6 @@ use std::fmt::{Display, Error, Formatter}; -use Value; +use crate::Value; impl Display for Value { fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { diff --git a/src/value/mod.rs b/src/value/mod.rs index e12bef9..7dd0c96 100644 --- a/src/value/mod.rs +++ b/src/value/mod.rs @@ -1,4 +1,4 @@ -use error::{EvalexprError, EvalexprResult}; +use crate::error::{EvalexprError, EvalexprResult}; mod display; pub mod value_type; @@ -202,7 +202,7 @@ impl From<()> for Value { #[cfg(test)] mod tests { - use value::{TupleType, Value}; + use crate::value::{TupleType, Value}; #[test] fn test_value_conversions() { diff --git a/src/value/value_type.rs b/src/value/value_type.rs index 997b09e..b6837e7 100644 --- a/src/value/value_type.rs +++ b/src/value/value_type.rs @@ -1,4 +1,4 @@ -use Value; +use crate::Value; /// The type of a `Value`. #[derive(Clone, Copy, Eq, PartialEq)]