mirror of
https://github.com/darkicewolf50/RustBrock.git
synced 2025-07-06 02:57:13 -06:00
started ch 11.1 and finished ch11 prelude
This commit is contained in:
14
adder/src/lib.rs
Normal file
14
adder/src/lib.rs
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user