Skip to content

Commit

Permalink
docs: improve comments on replace_func_by_id
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
  • Loading branch information
vados-cosmonic committed Oct 11, 2023
1 parent 0f4c7f7 commit 89a2841
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/module/functions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,12 @@ impl Module {
.context("module does not export a memory")
}

/// Replace a single function with the result of the provided builder function.
/// Replace a single function that is either an import or an export
/// with the result of the provided builder function.
///
/// When called, if `builder` produces a None value, the function in question will be
/// replaced with a stub that does nothing (more precisely, a function with an unreachable body).
pub fn replace_fn_by_id<F>(&mut self, fid: FunctionId, fn_builder: F) -> Result<()>
pub fn replace_func_by_id<F>(&mut self, fid: FunctionId, fn_builder: F) -> Result<()>
where
F: FnOnce((&FuncParams, &FuncResults)) -> Result<Option<LocalFunction>>,
{
Expand Down

0 comments on commit 89a2841

Please sign in to comment.