added workspaces example
This commit is contained in:
parent
eb0612b93b
commit
aec66ef7c8
5 changed files with 42 additions and 0 deletions
12
the_book/workspaces/add_one/src/lib.rs
Normal file
12
the_book/workspaces/add_one/src/lib.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
pub fn add_one(x: i32) -> i32 {
|
||||
x + 1
|
||||
}
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert_eq!(3, add_one(2))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue