RxSwiftCommunity / RxSwiftExt

A collection of Rx operators & tools not found in the core RxSwift distribution
MIT License
1.33k stars 213 forks source link

Avoid using force-unwraps of Optionals during .unwrap() #229

Closed Willamin closed 5 years ago

Willamin commented 5 years ago

trivial

rxswiftcommunity[bot] commented 5 years ago

It looks like code was changed without adding anything to the Changelog.

Generated by :no_entry_sign: dangerJS

M0rtyMerr commented 5 years ago

Hi @Willamin thanks for contribution. .filter { $0 != nil }.map { $0! } can be replaced with .compactMap

freak4pc commented 5 years ago

As Anton mentioned, .unwrap should not be used at this point since we we have compactMap. unwrap will be deprecated in a coming version of RxSwiftExt, but I think we should also make it use compactMap internally just so we're clear on it.

freak4pc commented 5 years ago

Do any of you want to make this use compactMap for now ?

M0rtyMerr commented 5 years ago

Sure, here https://github.com/RxSwiftCommunity/RxSwiftExt/pull/234