mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-05-15 07:06:52 +02:00
Use explicit range when slicing into string (#2664)
This commit is contained in:
parent
b4301e06c4
commit
df57606996
@ -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}");
|
||||
}
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user