mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-01-09 20:03:24 +03:00
e576824b69
The values in the vector are of type &str. But within the tests, the additional & is changing the test strings to type &&str resulting in error E0308 (mismatched types). error[E0308]: mismatched types --> exercises/standard_library_types/iterators1.rs:18:5 | 18 | assert_eq!(my_iterable_fav_fruits.next(), Some(&"banana")); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `str`, found `&str` | = note: expected enum `Option<&str>` found enum `Option<&&str>` = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) (I sure hope that comes out formatted correctly.) |
||
---|---|---|
.. | ||
advanced_errors | ||
clippy | ||
collections | ||
conversions | ||
enums | ||
error_handling | ||
functions | ||
generics | ||
if | ||
macros | ||
modules | ||
move_semantics | ||
option | ||
primitive_types | ||
standard_library_types | ||
strings | ||
structs | ||
tests | ||
threads | ||
traits | ||
variables | ||
quiz1.rs | ||
quiz2.rs | ||
quiz3.rs | ||
quiz4.rs | ||
README.md |
Exercise to Book Chapter mapping
Exercise | Book Chapter |
---|---|
variables | §3.1 |
functions | §3.3 |
if | §3.5 |
move_semantics | §4.1 |
primitive_types | §4.3 |
structs | §5.1 |
enums | §6 |
modules | §7 |
collections | §8.1, §8.3 |
strings | §8.2 |
error_handling | §9 |
generics | §10 |
option | §10.1 |
traits | §10.2 |
tests | §11.1 |
standard_library_types | §13.2 |
threads | §16.1 |
macros | §19.6 |
clippy | n/a |
conversions | n/a |