main -> lib

This commit is contained in:
bitfl0wer 2023-04-04 17:37:11 +02:00
parent 2d6410974f
commit 5e000afdc6
No known key found for this signature in database
GPG Key ID: 84BBB60DF895ABF2
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!");
}