mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-01-23 23:50:25 +08:00
Swap some emphasis underscores for asterisks
This commit is contained in:
parent
f341124f33
commit
a28ffd668d
@ -332,7 +332,7 @@ fn takes<T>(value: T) {
|
||||
}
|
||||
```
|
||||
|
||||
There's one problem though. We've got some function _definitions_ that work,
|
||||
There's one problem though. We've got some function *definitions* that work,
|
||||
but if we try to use `value` in code in the function body, we'll get an
|
||||
error. For example, the function definition in Listing 10-3 tries to print out
|
||||
`value` in its body:
|
||||
|
@ -49,7 +49,7 @@ This function takes one argument, a reference to some type, `T`, and the
|
||||
reference has the lifetime `'a`. In the same way that we parameterize functions
|
||||
that take generic types, we parameterize references with lifetimes.
|
||||
|
||||
So, that's the syntax, but _why_? What does a lifetime do, anyway?
|
||||
So, that's the syntax, but *why*? What does a lifetime do, anyway?
|
||||
|
||||
### Lifetimes Prevent Dangling References
|
||||
|
||||
@ -454,7 +454,7 @@ impl<'a> App<'a> {
|
||||
|
||||
### The Static Lifetime
|
||||
|
||||
There is _one_ special lifetime that Rust knows about: `'static`. The `'static`
|
||||
There is *one* special lifetime that Rust knows about: `'static`. The `'static`
|
||||
lifetime is the entire duration of the program. All string literals have the
|
||||
`'static` lifetime:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user