摘要:
``` fn main() { let s = String::from("hello dj"); //字符串字面值实际就是字符串的切片,所以 let ss ="hello dj"; //&s[..]其实等价于ss let s1 = first_word(&s[..]); println!("s1 is {}",s1); let s2 = first_word(ss); println!("s2 阅读全文
摘要:
所有权与函数 返回值与作用域 引用的使用 注意:同一个区域不允许可变和不可变引用同时存在例如下面这样 阅读全文