diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..d751034 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,19 @@ +#[no_mangle] +pub extern "C" fn add_one(x: u32) -> u32 { + x + 1 +} + +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}