How can i convert an iterator to tuple?


If i have a string that looks like this abcd:ef how can extract to two variables in rust

example (not working)

let (a1, a2) = item.split(':').collect::<(&str, &str)>();

There's collect tuple in itertools:

In std, I think you'll have to call .next repeatedly.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.