From a6ddb64596834bb2a61fa67d63b3cefb7fc3baea Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 1 Jan 2022 17:38:32 +0800 Subject: [PATCH] Fix builds. --- src/api/register.rs | 4 ++-- src/func/native.rs | 2 +- src/module/resolvers/collection.rs | 2 +- src/module/resolvers/file.rs | 2 +- src/parser.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/register.rs b/src/api/register.rs index 22276593..e369ab0c 100644 --- a/src/api/register.rs +++ b/src/api/register.rs @@ -79,7 +79,7 @@ impl Engine { name, FnNamespace::Global, FnAccess::Public, - param_type_names.as_ref().map(|v| v.as_ref()), + param_type_names.as_ref().map(<_>::as_ref), ¶m_types, func.into_callable_function(), ); @@ -137,7 +137,7 @@ impl Engine { name, FnNamespace::Global, FnAccess::Public, - param_type_names.as_ref().map(|v| v.as_ref()), + param_type_names.as_ref().map(<_>::as_ref), ¶m_types, func.into_callable_function(), ); diff --git a/src/func/native.rs b/src/func/native.rs index 457dc2f9..29317110 100644 --- a/src/func/native.rs +++ b/src/func/native.rs @@ -156,7 +156,7 @@ impl<'a> NativeCallContext<'a> { Self { engine, fn_name: fn_name.as_ref(), - source: source.map(S::as_ref), + source: source.map(<_>::as_ref), global: Some(global), lib, pos, diff --git a/src/module/resolvers/collection.rs b/src/module/resolvers/collection.rs index 835a8863..6deb7c3d 100644 --- a/src/module/resolvers/collection.rs +++ b/src/module/resolvers/collection.rs @@ -77,7 +77,7 @@ impl ModuleResolversCollection { /// Get an iterator of all the [module resolvers][ModuleResolver]. #[inline] pub fn iter(&self) -> impl Iterator { - self.0.iter().map(|v| v.as_ref()) + self.0.iter().map(<_>::as_ref) } /// Remove all [module resolvers][ModuleResolver]. #[inline(always)] diff --git a/src/module/resolvers/file.rs b/src/module/resolvers/file.rs index 1dcedd8e..ff6bfa88 100644 --- a/src/module/resolvers/file.rs +++ b/src/module/resolvers/file.rs @@ -225,7 +225,7 @@ impl FileModuleResolver { path: impl AsRef, source_path: Option>, ) -> Option> { - let file_path = self.get_file_path(path.as_ref(), source_path.as_ref().map(|v| v.as_ref())); + let file_path = self.get_file_path(path.as_ref(), source_path.as_ref().map(<_>::as_ref)); shared_write_lock(&self.cache) .remove_entry(&file_path) diff --git a/src/parser.rs b/src/parser.rs index 627a750c..348845d1 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -2623,7 +2623,7 @@ fn parse_export( pos: id_pos, }, Ident { - name: state.get_identifier("", rename.as_ref().map_or("", |s| s.as_ref())), + name: state.get_identifier("", rename.as_ref().map_or("", <_>::as_ref)), pos: rename_pos, }, ));