]>
Commit | Line | Data |
---|---|---|
74b04a01 XL |
1 | $ cargo run |
2 | Compiling collections v0.1.0 (file:///projects/collections) | |
fc512014 | 3 | error[E0277]: the type `String` cannot be indexed by `{integer}` |
74b04a01 XL |
4 | --> src/main.rs:3:13 |
5 | | | |
6 | 3 | let h = s1[0]; | |
fc512014 | 7 | | ^^^^^ `String` cannot be indexed by `{integer}` |
74b04a01 | 8 | | |
fc512014 | 9 | = help: the trait `Index<{integer}>` is not implemented for `String` |
064997fb FG |
10 | = help: the following other types implement trait `Index<Idx>`: |
11 | <String as Index<RangeFrom<usize>>> | |
12 | <String as Index<RangeFull>> | |
13 | <String as Index<RangeInclusive<usize>>> | |
14 | <String as Index<RangeTo<usize>>> | |
15 | <String as Index<RangeToInclusive<usize>>> | |
16 | <String as Index<std::ops::Range<usize>>> | |
17 | <str as Index<I>> | |
74b04a01 | 18 | |
74b04a01 | 19 | For more information about this error, try `rustc --explain E0277`. |
c295e0f8 | 20 | error: could not compile `collections` due to previous error |