Skip to content

Commit

Permalink
Use explicit range when slicing into string (#2664)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomPoison authored Feb 27, 2025
1 parent b4301e0 commit df57606
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/references/strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn main() {
s2.push_str(s1);
println!("s2: {s2}");
let s3: &str = &s2[s2.len() - s1.len()..];
let s3: &str = &s2[2..9];
println!("s3: {s3}");
}
```
Expand Down

0 comments on commit df57606

Please sign in to comment.