Advertisement
Guest User

Untitled

a guest
Jun 16th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.38 KB | None | 0 0
  1. fn foo(i: &mut i32) {
  2.     // do stuff
  3. }
  4.  
  5. fn main() {
  6.      // I have to bring &mut behind a RAW DATA. not a variable.but RAWDATA
  7.      // I have to deref i in foo before doing anything with it
  8.      // which will give me this error: you cant deref an ineteger !!
  9.     foo(&mut 10)
  10.    
  11.     foo(10) // I want to use this and I want rust be smart enough to deduce what does it mean
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement