Add Swift to Rust example.
This commit is contained in:
1
swift-to-rust/src/double.h
Normal file
1
swift-to-rust/src/double.h
Normal file
@@ -0,0 +1 @@
|
||||
int double_input(int input);
|
||||
4
swift-to-rust/src/lib.rs
Normal file
4
swift-to-rust/src/lib.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
#[no_mangle]
|
||||
pub extern fn double_input(input: i32) -> i32 {
|
||||
input * 2
|
||||
}
|
||||
1
swift-to-rust/src/main.swift
Normal file
1
swift-to-rust/src/main.swift
Normal file
@@ -0,0 +1 @@
|
||||
print(double_input(2))
|
||||
Reference in New Issue
Block a user