Short circuit no_function.
This commit is contained in:
parent
b4756b4575
commit
d7960dfe80
@ -100,10 +100,12 @@ impl CallableFunction {
|
|||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub const fn is_script(&self) -> bool {
|
pub const fn is_script(&self) -> bool {
|
||||||
match self {
|
#[cfg(feature = "no_function")]
|
||||||
#[cfg(not(feature = "no_function"))]
|
return false;
|
||||||
Self::Script(_) => true,
|
|
||||||
|
|
||||||
|
#[cfg(not(feature = "no_function"))]
|
||||||
|
match self {
|
||||||
|
Self::Script(_) => true,
|
||||||
Self::Pure(_) | Self::Method(_) | Self::Iterator(_) | Self::Plugin(_) => false,
|
Self::Pure(_) | Self::Method(_) | Self::Iterator(_) | Self::Plugin(_) => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,12 +125,14 @@ impl CallableFunction {
|
|||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub const fn is_native(&self) -> bool {
|
pub const fn is_native(&self) -> bool {
|
||||||
|
#[cfg(feature = "no_function")]
|
||||||
|
return true;
|
||||||
|
|
||||||
|
#[cfg(not(feature = "no_function"))]
|
||||||
match self {
|
match self {
|
||||||
Self::Pure(_) | Self::Method(_) => true,
|
Self::Pure(_) | Self::Method(_) => true,
|
||||||
Self::Plugin(_) => true,
|
Self::Plugin(_) => true,
|
||||||
Self::Iterator(_) => true,
|
Self::Iterator(_) => true,
|
||||||
|
|
||||||
#[cfg(not(feature = "no_function"))]
|
|
||||||
Self::Script(_) => false,
|
Self::Script(_) => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -136,11 +140,13 @@ impl CallableFunction {
|
|||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn access(&self) -> FnAccess {
|
pub fn access(&self) -> FnAccess {
|
||||||
|
#[cfg(feature = "no_function")]
|
||||||
|
return FnAccess::Public;
|
||||||
|
|
||||||
|
#[cfg(not(feature = "no_function"))]
|
||||||
match self {
|
match self {
|
||||||
Self::Plugin(_) => FnAccess::Public,
|
Self::Plugin(_) => FnAccess::Public,
|
||||||
Self::Pure(_) | Self::Method(_) | Self::Iterator(_) => FnAccess::Public,
|
Self::Pure(_) | Self::Method(_) | Self::Iterator(_) => FnAccess::Public,
|
||||||
|
|
||||||
#[cfg(not(feature = "no_function"))]
|
|
||||||
Self::Script(f) => f.access,
|
Self::Script(f) => f.access,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user