mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-01-23 23:50:25 +08:00
Clear up what 'it' is referring to. Fixes #287.
This commit is contained in:
parent
a97bf53cc2
commit
059d22658b
@ -5,8 +5,9 @@ return the `String` back to the calling function so that we can still use the
|
||||
`String` after the call to `calculate_length`, since the `String` was moved
|
||||
into `calculate_length`.
|
||||
|
||||
Here is how you would use a function without taking ownership of it using
|
||||
*references:*
|
||||
Here is how you would define and use a `calculate_length` function that takes a
|
||||
*reference* to an object as an argument instead of taking ownership of the
|
||||
argument:
|
||||
|
||||
Filename: src/main.rs
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user