1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Documentation comments are declared with three `/`s.
// It generates HTML and supports Markdown.
// This can be done and opened with `cargo doc --open`. It generates this for all crates in the
// package, internal and external.
// Usually, they contain:
// - Description: Short summary.
// - Examples: Important, useful examples.
// - Panics: Situation where the code panics.
// - Errors: About the E in Result<T, E>.
// - Safety: If the function uses unsafe, why and which variants are expected.
// Example code blocks in the comments are also ran with `cargo test`.
// Documentation comments can apply to the item that contains the comment, using //!
//! # Pedrov
//!
//! `pedrov` is a collection of utilities to make performing certain
//! calculations more convenient.
/// Adds one to the number given.
///
/// # Examples
///
/// ```
/// let arg = 5;
/// let answer = pedrov::add_one(arg);
///
/// assert_eq!(6, answer);
/// ```