From 15cc66b9885243fed7b4f3818ca4a80c3dc39b3d Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Mon, 19 Jul 2021 19:31:12 -0400 Subject: [PATCH] [fixup] reduce `ref`s --- snafu-derive/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snafu-derive/src/lib.rs b/snafu-derive/src/lib.rs index 573ce94f..80c2b3d6 100644 --- a/snafu-derive/src/lib.rs +++ b/snafu-derive/src/lib.rs @@ -1247,9 +1247,9 @@ impl EnumInfo { let error_impl = ErrorImpl(&self); let error_compat_impl = ErrorCompatImpl(&self); - let context = match self.module { + let context = match &self.module { None => quote! { #context_selectors }, - Some(ref module_name) => { + Some(module_name) => { use crate::shared::ContextModule; let context_module = ContextModule { @@ -1563,11 +1563,11 @@ impl NamedStructInfo { let pub_visibility = pub_visibility(); let selector_visibility = match (visibility, module) { - (Some(ref v), _) => Some(&**v), + (Some(v), _) => Some(&**v), (None, Some(_)) => { // Default to pub visibility since private context selectors // wouldn't be accessible outside the module. - Some(&pub_visibility as &dyn quote::ToTokens) + Some(&pub_visibility as _) } (None, None) => None, };