Scala type mismatch TraversableOnce and Iterator


#1

My library function need Iterator as type of argument but i have TraversableOnce type variable

How i can convert TraversableOnce to Iterator, i know TraversableOnce in sub class of Iterator , i try some method to convert but not success.

Anyone can help find some way to resolve this problem

Thank u very much


#2

There is a method .toIterator, which you apply to get, e.g., myTraversableOnce.toIterator

regards,
Siddhartha