Merge pull request #656 from kkoang/patch-2

comment没有翻译
pull/657/head
KaiserY 2 years ago committed by GitHub
commit 7a64d0d82b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,7 +7,7 @@ fn main() {
}
// ANCHOR: here
fn calculate_length(s: &String) -> usize { // s is a reference to a String
fn calculate_length(s: &String) -> usize { // s是String的引用
s.len()
} // 这里s 离开了作用域。但因为它并不拥有引用值的所有权,
// 所以什么也不会发生

Loading…
Cancel
Save