mirror of https://github.com/rust-lang/book
Update Listing 11-1 to reflect current contents
This commit is contained in:
parent
f2a78f64b6
commit
4ddb4f996b
|
@ -1,8 +1,14 @@
|
|||
pub fn add(left: usize, right: usize) -> usize {
|
||||
left + right
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = 2 + 2;
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue