Merge pull request #302 from ChloroplastYu/patch-2

chore: 修正错别字
This commit is contained in:
Sunface 2022-08-22 09:04:19 +08:00 committed by GitHub
commit aaf1913263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -123,7 +123,7 @@ fn main() {
};
// 通过这种解构式模式匹配person.name 的所有权被转移给新的变量 `name`
// 但是,这里 `age` 变量是对 person.age 的引用, 这里 ref 的使用相当于: let age = &person.age
// 但是,这里 `age` 变量是对 person.age 的引用, 这里 ref 的使用相当于: let age = &person.age
let Person { name, ref age } = person;
println!("The person's age is {}", age);