These are chat archives for rust-lang/rust
Hello all! :wave: I’m very new to Rust and I recently encountered this problem that I’ve spent a few hours on already
error[E0271]: type mismatch resolving `<std::env::Args as std::iter::Iterator>::Item == &str`
Here’s the full code in a playground. I’ve been able to make it work making
Item = String but I feel like I should be able to take a slice in the function. I’m very interested in understanding the guts of the issue :) Thank you! :smile:
Argsand the one that does exist returns
Strings, not string slices slices.
Iteratorthat returned slices?
Vecand then make such an iterator. Won't work without collecting, sorry.