main -> lib

This commit is contained in:
bitfl0wer 2023-04-04 17:37:11 +02:00
parent 2f0a35c0fa
commit 6f84797e98
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: 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);
}
}

View File

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