Created
March 21, 2018 17:13
-
-
Save BobGneu/0ec9db836023bee988894ec2dc8d2c4d to your computer and use it in GitHub Desktop.
Rust Documentation Article Code Example 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! ## Documentation Example | |
//! | |
//! This is a lot of great documentation, you ought to read and maintain this. | |
//! | |
//! Somehow i think, you are going to not do that. | |
//! | |
//! ```rust | |
//! fn it_works() { | |
//! assert_eq!(2 + 2, 4); | |
//! } | |
//! ``` | |
pub fn meaning_of_life(multiplier: i64) -> i64 { | |
return 42; | |
} | |
#[cfg(test)] | |
mod tests { | |
use super::*; | |
#[test] | |
fn it_works() { | |
assert_eq!(42, meaning_of_life(4)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment