Skip to content

Commit

Permalink
Fixed clunky grammar, that was difficult to read.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rossnkama authored Oct 29, 2023
1 parent 3dca2fc commit f1c531c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ch08-02-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ index to determine how many valid characters there were.

### Slicing Strings

Indexing into a string is often a bad idea because it’s not clear what the
return type of the string-indexing operation should be: a byte value, a
character, a grapheme cluster, or a string slice. If you really need to use
indices to create string slices, therefore, Rust asks you to be more specific.
Indexing into a string can be problematic because it's unclear what the return
type of the string-indexing operation should be: a byte value, a character,
a grapheme cluster, or a string slice. If you need to use indices to create
string slices, Rust requires you to be more specific.

Rather than indexing using `[]` with a single number, you can use `[]` with a
range to create a string slice containing particular bytes:
Expand Down

0 comments on commit f1c531c

Please sign in to comment.