From 27619b86db98606ef817a83cd947f326430f653e Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 12 Nov 2020 23:09:27 +0800 Subject: [PATCH] Fix builds. --- src/dynamic.rs | 2 +- src/parser.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dynamic.rs b/src/dynamic.rs index a66cc96b..cd4002d2 100644 --- a/src/dynamic.rs +++ b/src/dynamic.rs @@ -388,7 +388,7 @@ impl Hash for Dynamic { Union::Shared(cell) => (*cell.borrow()).hash(state), #[cfg(not(feature = "no_closure"))] #[cfg(feature = "sync")] - Union::Shared(cell) => (*cell.read().unwrap()).hash(hasher), + Union::Shared(cell) => (*cell.read().unwrap()).hash(state), _ => unimplemented!(), } diff --git a/src/parser.rs b/src/parser.rs index 4818aee2..68a63177 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -13,7 +13,7 @@ use crate::syntax::CustomSyntax; use crate::token::{ is_keyword_function, is_valid_identifier, Position, Token, TokenStream, NO_POS, }; -use crate::utils::StraightHasherBuilder; +use crate::utils::{ImmutableString, StraightHasherBuilder}; use crate::{calc_script_fn_hash, StaticVec}; #[cfg(not(feature = "no_float"))] @@ -26,7 +26,6 @@ use crate::engine::{make_getter, make_setter, KEYWORD_EVAL, KEYWORD_FN_PTR}; use crate::{ ast::FnAccess, engine::{FN_ANONYMOUS, KEYWORD_FN_PTR_CURRY}, - utils::ImmutableString, }; use crate::stdlib::{ @@ -169,6 +168,7 @@ impl<'e> ParseState<'e> { /// Get an interned string, creating one if it is not yet interned. pub fn get_interned_string(&mut self, text: String) -> ImmutableString { + #[allow(clippy::map_entry)] if !self.strings.contains_key(&text) { let value: ImmutableString = text.clone().into(); let result = value.clone(); @@ -2555,7 +2555,7 @@ fn make_curry_from_externals(fn_expr: Expr, externals: StaticVec, pos: Po #[cfg(feature = "no_closure")] externals.into_iter().for_each(|x| { - args.push(Expr::Variable(Box::new((None, None, 0, x.clone())))); + args.push(Expr::Variable(Box::new((None, None, 0, x.clone().into())))); }); let hash = calc_script_fn_hash(empty(), KEYWORD_FN_PTR_CURRY, num_externals + 1);