From c55b0d788337de8f07cb14a2167f53c6440193e8 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Wed, 19 Aug 2020 12:50:23 +0800 Subject: [PATCH] Fix bug with plugin method call detection. --- src/fn_native.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fn_native.rs b/src/fn_native.rs index 4d2cf19b..820e5dc7 100644 --- a/src/fn_native.rs +++ b/src/fn_native.rs @@ -261,7 +261,9 @@ impl CallableFunction { pub fn is_pure(&self) -> bool { match self { Self::Pure(_) => true, - Self::Method(_) | Self::Iterator(_) | Self::Plugin(_) => false, + Self::Method(_) | Self::Iterator(_) => false, + + Self::Plugin(p) => !p.is_method_call(), #[cfg(not(feature = "no_function"))] Self::Script(_) => false, @@ -271,7 +273,9 @@ impl CallableFunction { pub fn is_method(&self) -> bool { match self { Self::Method(_) => true, - Self::Pure(_) | Self::Iterator(_) | Self::Plugin(_) => false, + Self::Pure(_) | Self::Iterator(_) => false, + + Self::Plugin(p) => p.is_method_call(), #[cfg(not(feature = "no_function"))] Self::Script(_) => false,