bz_rust_util/lib.rs
1//! # BZ Rust Util
2//!
3//! `bz_rust_util` is a collection of utilities to make performing certain
4//! calculations more convenient.
5
6/// Adds one to the number given.
7// hahahahahahhahah
8
9/// Adds one to the number given.
10///
11/// # Examples
12///
13/// ```
14/// let arg = 5;
15/// let answer = bz_rust_util::add_one(arg);
16///
17/// assert_eq!(6, answer);
18/// ```
19pub fn add_one(x: i32) -> i32 {
20 x + 1
21}
22
23pub mod utils {
24 /// Adds one to the number given.
25 ///
26 /// # Examples
27 ///
28 /// ```
29 /// let arg = 5;
30 /// let answer = bz_rust_util::add_one2(arg);
31 ///
32 /// assert_eq!(7, answer);
33 /// ```
34 pub fn add_one2(x: i32) -> i32 {
35 x + 2
36 }
37}
38
39pub enum PrimaryColor {
40 Red,
41 Yellow,
42 Blue,
43}
44
45pub mod kinds {
46 /// The primary colors according to the RYB color model.
47
48 /// The secondary colors according to the RYB color model.
49 pub enum SecondaryColor {
50 Orange,
51 Green,
52 Purple,
53 }
54}
55
56#[cfg(test)]
57mod tests {
58 use super::*;
59
60 #[test]
61 fn it_works() {
62 let result = add_one(5);
63 assert_eq!(result, 6);
64 }
65 #[test]
66 fn it_works1() {
67 let result = utils::add_one2(5);
68 assert_eq!(result, 7);
69 }
70}