modified the project to become a library rather than a binary

This commit is contained in:
jellyfishsh 2025-04-12 19:30:21 -07:00
parent 5ffe2a75eb
commit af73775dc0
2 changed files with 14 additions and 3 deletions

14
src/lib.rs Normal file
View File

@ -0,0 +1,14 @@
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}

View File

@ -1,3 +0,0 @@
fn main() {
println!("Hello, world!");
}