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 <alekratz@gmail.com>
This commit is contained in:
@@ -69,7 +69,8 @@ pub enum Inst {
|
|||||||
// impl Inst
|
// impl 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 {
|
match self {
|
||||||
Inst::PushSym(_) => "PUSH_SYM",
|
Inst::PushSym(_) => "PUSH_SYM",
|
||||||
Inst::PushConst(_) => "PUSH_CONST",
|
Inst::PushConst(_) => "PUSH_CONST",
|
||||||
|
|||||||
Reference in New Issue
Block a user