[rust-dev] Passing arguments bu reference
christophe.pedretti at gmail.com
Mon Jun 2 10:49:38 PDT 2014
Great Thanks to all,
now i have a more precise idea.
So, to summarize
if the function takes a vector as argument, transforms it, and return it,
with no need for the caller to use the argument
fn my_func(src: Vec<u8>) -> Vec<u8>
if the functons takes a vector argument and use it just for a temporary
read access, with the need for the caller to use the argument (it was just
a borrow by the fcuntion)
fn my_func(src: &[u8]) -> Vec<u8>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rust-dev