bth_crust/
lib.rs

1//! # BTH_Crust
2//!
3//! `bth_crust` is a collection of utilities to make performing certain
4//! mathematical operations more convenient.
5
6pub use self::operations::add;
7pub use self::operations::sub;
8
9pub mod operations {
10
11    /// Add two numbers together
12    ///
13    /// ```
14    /// let x = 3;
15    /// let y = 5;
16    ///
17    /// let result = bth_crust::add(x, y);
18    ///
19    /// assert_eq!(result, 8);
20    /// ```
21    pub fn add(x: i32, y: i32) -> i32 {
22        x + y
23    }
24
25    /// Subtract two numbers together
26    ///
27    /// ```
28    /// let x = 5;
29    /// let y = 3;
30    ///
31    /// let result = bth_crust::sub(x, y);
32    ///
33    /// assert_eq!(result, 2);
34    /// ```
35    pub fn sub(x: i32, y: i32) -> i32 {
36        x - y
37    }
38}