Skip to content

Instantly share code, notes, and snippets.

@kunigami
Last active March 11, 2019 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunigami/e51310e3f53313eb49f6a070dd0a1702 to your computer and use it in GitHub Desktop.
Save kunigami/e51310e3f53313eb49f6a070dd0a1702 to your computer and use it in GitHub Desktop.
fn get_largest_with_lifetime<'a>(
v1: &'a Vec<i32>,
v2: &'a Vec<i32>
) -> &'a Vec<i32> {
if (v1.len() > v2.len()) {
return v1;
}
return v2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment