From ea855d29bdc44003eda5d51c373487a33eeaeb1c Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Fri, 21 Feb 2020 12:23:58 +0100 Subject: [PATCH] doc(interface-types) Add intra links. --- src/ast.rs | 2 +- src/decoders/binary.rs | 5 +++-- src/decoders/mod.rs | 3 ++- src/interpreter/mod.rs | 4 ++-- src/lib.rs | 41 +++++++++++++++++++++++------------------ 5 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/ast.rs b/src/ast.rs index beb77c1..d0c8cab 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -5,7 +5,7 @@ use crate::interpreter::Instruction; use std::str; /// Represents the types supported by WIT. -#[derive(PartialEq, Clone, Debug)] +#[derive(PartialEq, Debug)] pub enum InterfaceType { /// An integer. Int, diff --git a/src/decoders/binary.rs b/src/decoders/binary.rs index fbe2e29..26fa382 100644 --- a/src/decoders/binary.rs +++ b/src/decoders/binary.rs @@ -1,4 +1,4 @@ -//! Parse the WIT binary representation into an AST. +//! Parse the WIT binary representation into an [AST](crate::ast). use crate::{ast::*, interpreter::Instruction}; use nom::{ @@ -408,7 +408,8 @@ fn forwards<'input, E: ParseError<&'input [u8]>>( } /// Parse a sequence of bytes, expecting it to be a valid WIT binary -/// representation, into an `ast::Interfaces`. +/// representation, into an [`Interfaces`](crate::ast::Interfaces) +/// structure. /// /// # Example /// diff --git a/src/decoders/mod.rs b/src/decoders/mod.rs index 1b2aaaf..399bb89 100644 --- a/src/decoders/mod.rs +++ b/src/decoders/mod.rs @@ -1,5 +1,6 @@ //! Reads the AST from a particular data representation; for instance, -//! `decoders::binary` reads the AST from a binary. +//! [`decoders::binary`](binary) reads the [AST](crate::ast) +//! from a binary. pub mod binary; pub mod wat; diff --git a/src/interpreter/mod.rs b/src/interpreter/mod.rs index 792c91e..e7ef7f1 100644 --- a/src/interpreter/mod.rs +++ b/src/interpreter/mod.rs @@ -43,8 +43,8 @@ pub(crate) type ExecutableInstruction