hello_fn/lib.rs
1pub mod list;
2
3#[doc = "add is a function that add two number and returns number as usize"]
4pub fn add(left: usize, right: usize) -> usize {
5 left + right
6}
7
8#[cfg(test)]
9mod tests {
10 use super::*;
11
12 #[test]
13 fn it_works() {
14 let result = add(2, 2);
15 assert_eq!(result, 4);
16 }
17}