publishing_crates/lib.rs
1/// Adds one to the number given.
2///
3/// # Examples
4/// The example code below will be tested too, with cargo test
5///
6/// ```
7/// let arg = 5;
8/// let answer = publishing_crates::add_one(arg);
9///
10/// assert_eq!(6, answer);
11/// ```
12pub fn add_one(x: i32) -> i32 {
13 x + 1
14}
15
16// Putting 3 times / : code comment --> documentation comment
17// This feature displays the comment in markdown on the crates.io webpage
18
19// reexporting the modules can be very useful when wanting to simplify the use of your crates for other devs:
20// pub use self::utils::importantStuff
21// makes importantStuff available as:
22// use publishing_crates::importantStuff
23// which is more intuitive for crate users.