Skip to content

Commit

Permalink
Merge pull request rust-lang#2358 from rust-lang/gh1598
Browse files Browse the repository at this point in the history
Remove some confusing wording.
  • Loading branch information
steveklabnik authored Jun 5, 2020
2 parents 1f1658d + 69a02d4 commit 7763fcd
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/ch10-03-lifetime-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,10 @@ function to find the longer of two string slices</span>

Note that we want the function to take string slices, which are references,
because we don’t want the `longest` function to take ownership of its
parameters. We want to allow the function to accept slices of a `String` (the
type stored in the variable `string1`) as well as string literals (which is
what variable `string2` contains).

Refer to the [“String Slices as Parameters”][string-slices-as-parameters]<!--
ignore --> section in Chapter 4 for more discussion about why the parameters we
use in Listing 10-20 are the ones we want.
parameters. Refer to the [“String Slices as
Parameters”][string-slices-as-parameters]<!-- ignore --> section in Chapter 4
for more discussion about why the parameters we use in Listing 10-20 are the
ones we want.

If we try to implement the `longest` function as shown in Listing 10-21, it
won’t compile.
Expand Down

0 comments on commit 7763fcd

Please sign in to comment.