trpl-zh-cn/listings/ch08-common-collections/listing-08-19/output.txt

13 lines
458 B
Plaintext
Raw Normal View History

2022-02-06 16:43:51 +08:00
$ cargo run
Compiling collections v0.1.0 (file:///projects/collections)
error[E0277]: the type `String` cannot be indexed by `{integer}`
--> src/main.rs:3:13
|
3 | let h = s1[0];
| ^^^^^ `String` cannot be indexed by `{integer}`
|
= help: the trait `Index<{integer}>` is not implemented for `String`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `collections` due to previous error