From a9d59be4728b0af41e8ba52814af55dd741244db Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Tue, 10 Nov 2020 19:17:27 -0800 Subject: [PATCH] Update the Inst::name() function to be `const` This can be `const` because it just returns a static string value. Signed-off-by: Alek Ratzloff --- src/vm/inst.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vm/inst.rs b/src/vm/inst.rs index 6025ba4..f3db323 100644 --- a/src/vm/inst.rs +++ b/src/vm/inst.rs @@ -69,7 +69,8 @@ pub enum Inst { // impl Inst // impl Inst { - pub fn name(&self) -> &'static str { + /// Gets the printable name of this instruction. + pub const fn name(&self) -> &'static str { match self { Inst::PushSym(_) => "PUSH_SYM", Inst::PushConst(_) => "PUSH_CONST",