summaryrefslogtreecommitdiff
path: root/meap/meap-code/ch2/ch2-add-with-lifetimes.rs
blob: 89c8bfe6aaefcbd87c59e48e40e6cfa88e2ce3bb (plain) (blame)
1
2
3
4
5
6
7
8
fn add_with_lifetimes<'a, 'b>(i: &'a i32, j: &'b i32) -> i32 {
  *i + *j
}

fn main() {
  let res = add_with_lifetimes(&10, &20);
  println!("{}", res);
}