mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 12:39:42 +00:00
Update basic.md
change 标准 to 标注
This commit is contained in:
@ -77,7 +77,7 @@ fn print_one<'a>(x: &'a i32) {
|
||||
println!("`print_one`: x is {}", x);
|
||||
}
|
||||
|
||||
// 可变引用依然需要标准生命周期
|
||||
// 可变引用依然需要标注生命周期
|
||||
fn add_one<'a>(x: &'a mut i32) {
|
||||
*x += 1;
|
||||
}
|
||||
@ -163,7 +163,7 @@ fn main() {
|
||||
#### Structs
|
||||
6. 🌟
|
||||
```rust,editable
|
||||
/* 增加合适的生命周期标准,让代码工作 */
|
||||
/* 增加合适的生命周期标注,让代码工作 */
|
||||
|
||||
// `i32` 的引用必须比 `Borrowed` 活得更久
|
||||
#[derive(Debug)]
|
||||
|
Reference in New Issue
Block a user