New Procedural Macros Crate v0.1
This commit is contained in:
22
codegen/ui_tests/first_shared_ref.rs
Normal file
22
codegen/ui_tests/first_shared_ref.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use rhai::export_fn;
|
||||
|
||||
struct NonClonable {
|
||||
a: f32,
|
||||
b: u32,
|
||||
c: char,
|
||||
d: bool,
|
||||
}
|
||||
|
||||
#[export_fn]
|
||||
pub fn test_fn(input: &NonClonable) -> bool {
|
||||
input.d
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let n = NonClonable { a: 0.0, b: 10, c: 'a', d: true };
|
||||
if test_fn(n) {
|
||||
println!("yes");
|
||||
} else {
|
||||
println!("no");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user