Skip to content

Commit 2a12454

Browse files
committed
add docs to Op and OpCode types
1 parent fd0dc76 commit 2a12454

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

crates/ir2/build/display/op.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ impl Display for DisplayOp<&'_ Isa> {
7979
write!(
8080
f,
8181
"\
82+
{indent}/// A Wasmi bytecode operator or instruction.
8283
{indent}#[allow(non_camel_case_types)]\n\
8384
{indent}pub enum Op {{\n\
8485
{variants}\n\

crates/ir2/build/display/op_code.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ impl Display for DisplayOpCode<&'_ Isa> {
5050
f,
5151
"\
5252
{indent}#[allow(non_camel_case_types)]\n\
53+
{indent}/// The operator code (op-code) of a Wasmi bytecode [`Op`](crate::Op).
5354
{indent}#[repr(u16)]\n\
5455
{indent}pub enum OpCode {{\n\
5556
{variants}\n\
5657
{indent}}}\n\
5758
\n\
5859
{indent}impl Op {{\n\
60+
{indent} /// Returns the [`OpCode`] associated to `self`.
5961
{indent} pub fn code(&self) -> OpCode {{\n\
6062
{indent} match self {{\n\
6163
{match_arms_code}\n\

0 commit comments

Comments
 (0)