ryanmcgrath / cacao

Rust bindings for AppKit (macOS) and UIKit (iOS/tvOS). Experimental, but working!
MIT License
1.79k stars 65 forks source link

Idiomatic NSArray iteration #97

Closed agg23 closed 11 months ago

agg23 commented 11 months ago

I went to pull some data out of a NSArray, and found that the array did not follow idiomatic iterator design. I was going to leave the original map method around, but found that it was referenced in only a few spots, and several of those spots wanted iterators anyway.

So this adds NSArray iteration, and removes the .map(transform) method, which was equivalent to .iter().map(transform).collect()

ryanmcgrath commented 11 months ago

Ha, you found some very early code. This makes sense to me and I'm happy to merge it. Thanks!