rhai/codegen/ui_tests/rhai_mod_non_clonable_return.rs

30 lines
442 B
Rust
Raw Normal View History

2020-09-08 23:04:04 +02:00
use rhai::plugin::*;
struct NonClonable {
a: f32,
b: u32,
c: char,
d: bool,
}
#[export_module]
pub mod test_mod {
pub fn test_fn(input: f32) -> NonClonable {
NonClonable {
a: input,
b: 10,
c: 'a',
d: true,
}
}
}
fn main() {
let n = test_mod::test_fn(20.0);
if n.c == 'a' {
println!("yes");
} else {
println!("no");
}
}