1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/// Adds one to the number given.
///
/// # Examples
/// The example code below will be tested too, with cargo test
///
/// ```
/// let arg = 5;
/// let answer = publishing_crates::add_one(arg);
///
/// assert_eq!(6, answer);
/// ```
pub fn add_one(x: i32) -> i32 {
    x + 1
}

// Putting 3 times / : code comment --> documentation comment
// This feature displays the comment in markdown on the crates.io webpage

// reexporting the modules can be very useful when wanting to simplify the use of your crates for other devs:
// pub use self::utils::importantStuff
// makes importantStuff available as:
// use publishing_crates::importantStuff
// which is more intuitive for crate users.