mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-02-24 05:13:29 +08:00
16 lines
203 B
Rust
Executable File
16 lines
203 B
Rust
Executable File
// 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));
|
|
}
|
|
}
|