Skip to content

Commit

Permalink
docs: fix and improve some docs (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
yjhmelody authored Oct 18, 2022
1 parent 00bbcd0 commit b11271f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion crates/wasmi/src/engine/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct Executor<'ctx, 'engine, 'func, HostData> {
value_stack: ValueStackRef<'engine>,
/// A mutable [`Store`] context.
///
/// [`Store`]: [`crate::v1::Store`]
/// [`Store`]: [`crate::Store`]
ctx: StoreContextMut<'ctx, HostData>,
/// Stores frequently used instance related data.
cache: &'engine mut InstanceCache,
Expand Down
4 changes: 2 additions & 2 deletions crates/wasmi/src/engine/stack/values/vref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl<'a> ValueStackRef<'a> {
///
/// # Note
///
/// This has the same effect as [`ValueStackRef::peek`]`(0)`.
/// This has the same effect as [`ValueStackRef::peek`]`(1)`.
#[inline]
pub fn last(&self) -> UntypedValue {
self.get_release_unchecked(self.stack_ptr - 1)
Expand All @@ -143,7 +143,7 @@ impl<'a> ValueStackRef<'a> {
///
/// # Note
///
/// This has the same effect as [`ValueStackRef::peek`]`(0)`.
/// This has the same effect as [`ValueStackRef::peek`]`(1)`.
#[inline]
pub fn last_mut(&mut self) -> &mut UntypedValue {
self.get_release_unchecked_mut(self.stack_ptr - 1)
Expand Down
2 changes: 1 addition & 1 deletion crates/wasmi/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl Global {
///
/// This API is primarily used by the [`Store`] itself.
///
/// [`Store`]: [`crate::v1::Store`]
/// [`Store`]: [`crate::Store`]
pub(super) fn from_inner(stored: Stored<GlobalIdx>) -> Self {
Self(stored)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/wasmi/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl Instance {
///
/// This API is primarily used by the [`Store`] itself.
///
/// [`Store`]: [`crate::v1::Store`]
/// [`Store`]: [`crate::Store`]
pub(super) fn from_inner(stored: Stored<InstanceIdx>) -> Self {
Self(stored)
}
Expand Down
8 changes: 4 additions & 4 deletions crates/wasmi/src/module/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ impl Export {
/// [`Module`]: [`super::Module`]
#[derive(Debug, Copy, Clone)]
pub enum External {
/// An exported function and its index witihn the [`Module`].
/// An exported function and its index within the [`Module`].
///
/// [`Module`]: [`super::Module`]
Func(FuncIdx),
/// An exported table and its index witihn the [`Module`].
/// An exported table and its index within the [`Module`].
///
/// [`Module`]: [`super::Module`]
Table(TableIdx),
/// An exported linear memory and its index witihn the [`Module`].
/// An exported linear memory and its index within the [`Module`].
///
/// [`Module`]: [`super::Module`]
Memory(MemoryIdx),
/// An exported global variable and its index witihn the [`Module`].
/// An exported global variable and its index within the [`Module`].
///
/// [`Module`]: [`super::Module`]
Global(GlobalIdx),
Expand Down
6 changes: 3 additions & 3 deletions crates/wasmi/src/module/instantiate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Module {
/// provided [`Func`] has a different function signature than required by the module import.
///
/// [`Linker`]: struct.Linker.html
/// [`Func`]: [`crate::v1::Func`]
/// [`Func`]: [`crate::Func`]
pub(crate) fn instantiate<I>(
&self,
mut context: impl AsContextMut,
Expand Down Expand Up @@ -95,7 +95,7 @@ impl Module {
/// - If the externally provided [`Table`], [`Memory`], [`Func`] or [`Global`] has a type
/// mismatch with the expected module import type.
///
/// [`Func`]: [`crate::v1::Func`]
/// [`Func`]: [`crate::Func`]
fn extract_imports<I>(
&self,
context: &mut impl AsContextMut,
Expand Down Expand Up @@ -168,7 +168,7 @@ impl Module {
/// This also stores [`Func`] references into the [`Instance`] under construction.
///
/// [`Store`]: struct.Store.html
/// [`Func`]: [`crate::v1::Func`]
/// [`Func`]: [`crate::Func`]
fn extract_functions(
&self,
context: &mut impl AsContextMut,
Expand Down

0 comments on commit b11271f

Please sign in to comment.