summaryrefslogtreecommitdiff
path: root/xmake/templates/rust/shared/src
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/templates/rust/shared/src')
-rw-r--r--xmake/templates/rust/shared/src/foo.rs4
-rw-r--r--xmake/templates/rust/shared/src/main.rs6
2 files changed, 10 insertions, 0 deletions
diff --git a/xmake/templates/rust/shared/src/foo.rs b/xmake/templates/rust/shared/src/foo.rs
new file mode 100644
index 000000000..a3a3aa4a6
--- /dev/null
+++ b/xmake/templates/rust/shared/src/foo.rs
@@ -0,0 +1,4 @@
+pub fn add(a: i32, b: i32) -> i32 {
+ return a + b;
+}
+
diff --git a/xmake/templates/rust/shared/src/main.rs b/xmake/templates/rust/shared/src/main.rs
new file mode 100644
index 000000000..205d23da3
--- /dev/null
+++ b/xmake/templates/rust/shared/src/main.rs
@@ -0,0 +1,6 @@
+extern crate foo;
+
+fn main() {
+ println!("hello xmake!");
+ println!("add: {}", foo::add(1, 1));
+}