ralgo/
a_plus_b.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::ops::Add;

pub fn a_plus_b<T: Add<Output = T>>(a: T, b: T) -> T {
    return a + b;
}

#[cfg(test)]
mod test {
    use super::*;
    #[test]
    fn it_works() {
        assert_eq!(a_plus_b(2, 3), 5)
    }
}