fiano_swap 0.1.0

A simple generic swap function for two values using Copy trait. This library provides a safe and easy way to swap variables in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

pub fn swap<T: Copy>(a: &mut T, b: &mut T) {
    let c : T = *a;
    *a = *b;
    *b = c;
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn it_works() {
    }
}