Skip to main content

addition_lib/
lib.rs

1//! # Addition module
2//!
3//! This module adds functionality to add values
4//! that implement Add trait on them
5
6
7use std::ops::Add;
8
9/// Adds one value with Add trait to the other
10///
11/// # Examples
12///
13/// ```
14/// let value = 1;
15/// let value_two = 2;
16///
17/// assert_eq!(addition_lib::addition(value, value_two), 3);
18///
19/// ```
20pub fn addition<T: Add<Output = T>>(one: T, two: T) -> T {
21    one + two
22}