File: rhai_fn_duplicate_attr.rs

package info (click to toggle)
rust-rhai-codegen 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 888 kB
  • sloc: makefile: 2
file content (18 lines) | stat: -rw-r--r-- 323 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use rhai::plugin::*;

#[export_module]
pub mod test_module {
    #[rhai_fn(name = "test")]
    #[rhai_fn(pure)]
    pub fn test_fn(input: Point) -> bool {
        input.x > input.y
    }
}

fn main() {
    if test_module::test_fn(n) {
        println!("yes");
    } else {
        println!("no");
    }
}