To compile, use the following command:

 rustc +nightly --target wasm32-unknown-unknown -O --crate-type=cdylib main.rs -o canvas.wasm