mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-02-24 13:22:19 +08:00
16 lines
203 B
Rust
16 lines
203 B
Rust
|
// ANCHOR: here
|
||
|
pub fn add_two(a: i32) -> i32 {
|
||
|
a + 3
|
||
|
}
|
||
|
// ANCHOR_END: here
|
||
|
|
||
|
#[cfg(test)]
|
||
|
mod tests {
|
||
|
use super::*;
|
||
|
|
||
|
#[test]
|
||
|
fn it_adds_two() {
|
||
|
assert_eq!(4, add_two(2));
|
||
|
}
|
||
|
}
|