summaryrefslogtreecommitdiff
path: root/xmake/templates/rust/shared/src
diff options
context:
space:
mode:
authorruki <[email protected]>2026-08-09 18:25:05 +0800
committerGitHub <[email protected]>2026-08-09 18:25:05 +0800
commitced7f2ae519bc9eca92bcf4f177fe177ddd0e747 (patch)
treeaf4d584b3c7badc1df56038cdb29099b4f3e99fd /xmake/templates/rust/shared/src
parent6ac4ea833193a4319a1eb6e5f588d1877fd48064 (diff)
parent5f5daf64c504e1103a355f45bf925a5149b03e24 (diff)
Merge pull request #7699 from xmake-io/templates
move templates dir
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));
+}