Skip to content

Instantly share code, notes, and snippets.

@rchaser53
Created December 16, 2018 13:58
Show Gist options
  • Save rchaser53/3c9cb3a0c095e002cc38aa2a0852481a to your computer and use it in GitHub Desktop.
Save rchaser53/3c9cb3a0c095e002cc38aa2a0852481a to your computer and use it in GitHub Desktop.
situation for borrow
foo(&i);
foo(&mut i);
fn foo<T: Borrow<i32> + Display>(a: T) {
println!("a is borrowed: {}", a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment