/// This function takes ownership of the variable fn move_and_destroy<T: std::fmt::Show>(c: T) { // Have to return it to be claimed again. println!("destroying a variable that contains {}" , c); // `c` will be destroyed in this scope, and the memory will be freed } ///this function prints the value of d fn borrow_variable<T: std::fmt::Show>(d: &T) { // Do not have to return the variable to let the caller reclaim it println!("variable, {} is borrowed!" , d); } ///this function alters f fn borrow_mut_variable(f: &mut f64) { *f = 42.0; }