Skip to main content

add_one_boring/
lib.rs

1//! # Add one boring
2//!
3//! `add_one_boring` is a collection of utilities to make performing certain
4//! calculations more convenient.
5
6pub use self::sum::add_one_boring;
7
8pub mod sum {
9    /// Adds one to the number given.
10    // --snip--
11
12    /// Adds one to the number given.
13    ///
14    /// # Examples
15    ///
16    /// ```
17    /// let arg = 5;
18    /// let answer = add_one_boring::add_one_boring(arg);
19    ///
20    /// assert_eq!(6, answer);
21    /// ```
22    pub fn add_one_boring(x: i32) -> i32 {
23        x + 1
24    }
25
26    #[cfg(test)]
27    mod tests {
28        use super::*;
29
30        #[test]
31        fn it_works() {
32            assert_eq!(add_one_boring(4), 5);
33        }
34    }
35}