[examples] duck-typed-interfaces - port to rust 2018

This commit is contained in:
LachezarLechev 2018-12-11 08:45:26 +01:00
parent 7107a896da
commit 573c14118a
2 changed files with 2 additions and 2 deletions

View File

@ -2,6 +2,7 @@
name = "rust-duck-typed-interfaces"
version = "0.1.0"
authors = ["The wasm-bindgen Developers"]
edition = "2018"
[lib]
crate-type = ["cdylib"]

View File

@ -1,4 +1,3 @@
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
/// Here is a duck-typed interface for any JavaScript object that has a `quack`
@ -18,6 +17,6 @@ extern "C" {
/// Next, we can export a function that takes any object that quacks:
#[wasm_bindgen]
pub fn make_em_quack_to_this(duck: &Quacks) {
let s = duck.quack();
let _s = duck.quack();
// ...
}