thlorenz / rid

Rust integrated Dart framework providing an easy way to build Flutter apps with Rust.
64 stars 4 forks source link

fix: reexported string args #29

Closed thlorenz closed 2 years ago

thlorenz commented 2 years ago

Fixing string args passed from reexported methods.

Namely the below resulted in incorrectly generated Dart code:

#[rid::export]
impl Store {
    #[rid::export]
    fn get_string_len(&self, arg: String) -> usize {
        arg.len()
    }
}

It was missing the toNativeInt8() call before passing the String to the lower level exported method.

This change fixes that.