Move pure checking out of functions.

This commit is contained in:
Stephen Chung
2022-10-27 20:42:10 +08:00
parent 4708fde8bd
commit 4100645512
11 changed files with 120 additions and 102 deletions

View File

@@ -29,4 +29,14 @@ pub trait PluginFunction {
/// Is this plugin function a method?
#[must_use]
fn is_method_call(&self) -> bool;
/// Is this plugin function pure?
///
/// This defaults to `true` such that any old implementation that has constant-checking code
/// inside the function itself will continue to work.
#[inline(always)]
#[must_use]
fn is_pure(&self) -> bool {
true
}
}