rust_template_example/lib.rs
1//! # `rust-template-example` library crate
2//!
3//! If you are reading this, you are reading the documentation for the `rust-template-example` library crate. For the cli, kindly refer to the README file.
4
5#![deny(missing_docs)]
6#![warn(clippy::all, clippy::nursery, clippy::pedantic, clippy::cargo)]
7
8/// Add two numbers together.
9pub fn add(left: u64, right: u64) -> u64 {
10 left + right
11}
12
13#[cfg(test)]
14mod tests {
15 use super::*;
16
17 #[test]
18 fn it_works() {
19 let result = add(2, 2);
20 assert_eq!(result, 4);
21 }
22}