1 2 3 4 5 6 7 8 9 10 11 12 13 14
/// Adds two to the input. pub fn add_two(x: i32) -> i32 { x + 2 } #[cfg(test)] mod tests { use super::*; #[test] fn it_works() { assert_eq!(add_two(2), 4); } }