Fix rustdoc tests.

This commit is contained in:
Sergey Pepyakin 2018-01-26 17:40:37 +03:00
parent 49d57bf159
commit b27aaec434
3 changed files with 8 additions and 8 deletions

View File

@ -80,12 +80,12 @@ pub trait ImportResolver {
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
/// use wasmi::{load_from_buffer, ModuleInstance, ImportsBuilder}; /// use wasmi::{ModuleInstance, ImportsBuilder};
/// # /// #
/// # struct EnvModuleResolver; /// # struct EnvModuleResolver;
/// # impl ::wasmi::ModuleImportResolver for EnvModuleResolver { } /// # impl ::wasmi::ModuleImportResolver for EnvModuleResolver { }
/// # fn func() -> Result<(), ::wasmi::Error> { /// # fn func() -> Result<(), ::wasmi::Error> {
/// # let module = load_from_buffer(&[0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00]).unwrap(); /// # let module = wasmi::Module::from_buffer(&[0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00]).unwrap();
/// # let other_instance = ModuleInstance::new(&module, &ImportsBuilder::default())?.assert_no_start(); /// # let other_instance = ModuleInstance::new(&module, &ImportsBuilder::default())?.assert_no_start();
/// ///
/// let imports = ImportsBuilder::new() /// let imports = ImportsBuilder::new()

View File

@ -68,7 +68,7 @@
//! .expect("failed to parse wat"); //! .expect("failed to parse wat");
//! //!
//! // Load wasm binary and prepare it for instantiation. //! // Load wasm binary and prepare it for instantiation.
//! let module = wasmi::load_from_buffer(&wasm_binary) //! let module = wasmi::Module::from_buffer(&wasm_binary)
//! .expect("failed to load wasm"); //! .expect("failed to load wasm");
//! //!
//! // Instantiate a module with empty imports and //! // Instantiate a module with empty imports and

View File

@ -420,9 +420,9 @@ impl ModuleInstance {
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
/// use wasmi::{load_from_buffer, ModuleInstance, ImportsBuilder, NopExternals}; /// use wasmi::{ModuleInstance, ImportsBuilder, NopExternals};
/// # fn func() -> Result<(), ::wasmi::Error> { /// # fn func() -> Result<(), ::wasmi::Error> {
/// # let module = load_from_buffer(&[0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00]).unwrap(); /// # let module = wasmi::Module::from_buffer(&[0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00]).unwrap();
/// ///
/// // ModuleInstance::new returns instance which `start` function isn't called. /// // ModuleInstance::new returns instance which `start` function isn't called.
/// let not_started = ModuleInstance::new( /// let not_started = ModuleInstance::new(
@ -440,9 +440,9 @@ impl ModuleInstance {
/// instantiated module without calling `start` function. /// instantiated module without calling `start` function.
/// ///
/// ```rust /// ```rust
/// use wasmi::{load_from_buffer, ModuleInstance, ImportsBuilder, NopExternals}; /// use wasmi::{ModuleInstance, ImportsBuilder, NopExternals};
/// # fn func() -> Result<(), ::wasmi::Error> { /// # fn func() -> Result<(), ::wasmi::Error> {
/// # let module = load_from_buffer(&[0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00]).unwrap(); /// # let module = wasmi::Module::from_buffer(&[0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00]).unwrap();
/// ///
/// // This will panic if the module actually contain `start` function. /// // This will panic if the module actually contain `start` function.
/// let not_started = ModuleInstance::new( /// let not_started = ModuleInstance::new(
@ -536,7 +536,7 @@ impl ModuleInstance {
/// # ) /// # )
/// # "#, /// # "#,
/// # ).expect("failed to parse wat"); /// # ).expect("failed to parse wat");
/// # let module = wasmi::load_from_buffer(&wasm_binary).expect("failed to load wasm"); /// # let module = wasmi::Module::from_buffer(&wasm_binary).expect("failed to load wasm");
/// # let instance = ModuleInstance::new( /// # let instance = ModuleInstance::new(
/// # &module, /// # &module,
/// # &ImportsBuilder::default() /// # &ImportsBuilder::default()