diff --git a/CHANGELOG.md b/CHANGELOG.md index 9178cf87..04b4baa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Enhancements * The `TypeBuilder` type and `CustomType` trait are no longer marked as volatile. * `FuncArgs` is also implemented for arrays. * `Engine::set_XXX` API can now be chained. +* `EvalContext::scope_mut` now returns `&mut Scope` instead of `&mut &mut Scope`. Version 1.11.0 diff --git a/src/eval/eval_context.rs b/src/eval/eval_context.rs index a38f800b..df6a87e3 100644 --- a/src/eval/eval_context.rs +++ b/src/eval/eval_context.rs @@ -61,8 +61,8 @@ impl<'a, 's, 'ps, 'g, 'c, 't> EvalContext<'a, 's, 'ps, 'g, 'c, 't> { /// Get a mutable reference to the current [`Scope`]. #[inline(always)] #[must_use] - pub fn scope_mut(&mut self) -> &mut &'s mut Scope<'ps> { - &mut self.scope + pub fn scope_mut(&mut self) -> &mut Scope<'ps> { + self.scope } /// Get an iterator over the current set of modules imported via `import` statements, /// in reverse order (i.e. modules imported last come first). @@ -105,7 +105,7 @@ impl<'a, 's, 'ps, 'g, 'c, 't> EvalContext<'a, 's, 'ps, 'g, 'c, 't> { #[cfg(not(feature = "no_function"))] #[inline] pub fn iter_namespaces(&self) -> impl Iterator { - self.global.lib.iter().map(|m| m.as_ref()) + self.global.lib.iter().map(AsRef::as_ref) } /// _(internals)_ The current set of namespaces containing definitions of all script-defined functions. /// Exported under the `internals` feature only.