pub mod AddOne { /* * Example of documentation code. The documentation code is compiled as HTMl by cargo * The documentation below includes examples on how to use the functions. * Rust runs those examples as documentation tests when you type `cargo test`. * You can run only documentation tests with: `cargo test --doc`. * * Beside examples, there are other common sections that one usually introduces in * their crate: Errors, Panics and Safety (when unsafe Rust is implemented). * * `cargo doc --open` opens the documentation file in a web browser. */ /// Adds one to the given number. /// /// # Examples /// /// ``` /// let arg = 5; /// let answer = publish_demo_luispdm::AddOne::addOne(arg); /// /// assert_eq!(6, answer); /// ``` pub fn addOne(x: u64) -> u64 { x+1 } } pub mod AddTwo { pub fn addTwo(x: u64) -> u64 { x+2 } }