diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/error.rs | 10 | ||||
-rw-r--r-- | src/value.rs | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/error.rs b/src/error.rs index 9b05bf6..de22dc7 100644 --- a/src/error.rs +++ b/src/error.rs @@ -81,7 +81,7 @@ pub enum Error { /// Argument name. name: Option<StdString>, /// Underlying error returned when converting argument to a Lua value. - error: Arc<Error>, + cause: Arc<Error>, }, /// A Rust value could not be converted to a Lua value. ToLuaConversionError { @@ -230,7 +230,7 @@ impl fmt::Display for Error { fmt, "too many arguments to Function::bind" ), - Error::BadArgument { ref to, pos, ref name, ref error } => { + Error::BadArgument { ref to, pos, ref name, ref cause } => { if let Some(name) = name { write!(fmt, "bad argument `{name}`")?; } else { @@ -239,7 +239,7 @@ impl fmt::Display for Error { if let Some(to) = to { write!(fmt, " to `{to}`")?; } - write!(fmt, ": {error}") + write!(fmt, ": {cause}") }, Error::ToLuaConversionError { from, to, ref message } => { write!(fmt, "error converting {from} to Lua {to}")?; @@ -329,12 +329,12 @@ impl Error { Error::ExternalError(err.into().into()) } - pub(crate) fn bad_self_argument(to: &str, error: Error) -> Self { + pub(crate) fn bad_self_argument(to: &str, cause: Error) -> Self { Error::BadArgument { to: Some(to.to_string()), pos: 1, name: Some("self".to_string()), - error: Arc::new(error), + cause: Arc::new(cause), } } diff --git a/src/value.rs b/src/value.rs index 91b9d19..dfe8379 100644 --- a/src/value.rs +++ b/src/value.rs @@ -205,7 +205,7 @@ pub trait FromLua<'lua>: Sized { to: to.map(|s| s.to_string()), pos: i, name: None, - error: Arc::new(err), + cause: Arc::new(err), }) } } |