singlestore-labs / singlestore-wasm-toolkit

Tools to streamline development of Wasm UDFs for SingleStoreDB.
Apache License 2.0
17 stars 8 forks source link

Copying from Rust Example Adds Extra Code #40

Closed mitchwadair closed 2 years ago

mitchwadair commented 2 years ago

When doing the tutorial for power-of, I copied the Rust code from the doc site and it embedded the code into a main fn:


#![allow(unused)]
fn main() {
wit_bindgen_rust::export!("power.wit");
struct Power;

impl power::Power for Power {
    fn power_of(base: i32, exp: i32) -> i32 {
        let mut res = 1;
        for _i in 0..exp {
            res *= base;
        }
        res
    }
}
}

This caused an E0412 error when compiling. Checked with @pvetere and this is not intended. Not sure if this affects other tutorials/code examples or not (I'm guessing it probably does). Doesn't seem to happen when copying directly from the GitHub docs, just the doc site.