Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,3 @@
fn generic_swap<'a, T>(var1: &'a mut T, var2: &'a mut T) {
std::mem::swap(var1, var2)
}

View file

@ -0,0 +1,12 @@
fn main() {
let mut a: String = "Alice".to_owned();
let mut b: String = "Bob".to_owned();
let mut c: i32 = 1;
let mut d: i32 = 2;
generic_swap(&mut a, &mut b);
generic_swap(&mut c, &mut d);
println!("a={}, b={}", a, b);
println!("c={}, d={}", c, d);
}