Skip to content

Instantly share code, notes, and snippets.

@Haniyya
Created May 26, 2019 05:21
Show Gist options
  • Save Haniyya/b2ff3f82b1519f67d2c7a72b102801b7 to your computer and use it in GitHub Desktop.
Save Haniyya/b2ff3f82b1519f67d2c7a72b102801b7 to your computer and use it in GitHub Desktop.
// Consumes value, returns nothing (cannot be assigned)
fn eat_it(c: Cake) {}
// Consumes value, returns another **different** value
fn recycle(c: Cake) -> Cake {}
// Reads value. Nothing more.
fn look_at(c: &Cake) {}
// Changes the cake we pass into it.
fn decorate(c: &mut Cake) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment