devxoul / Then

✨ Super sweet syntactic sugar for Swift initializers
MIT License
4.16k stars 290 forks source link

fixed XCode's 'Result is unused'-warning #57

Closed domingguss closed 4 years ago

domingguss commented 6 years ago

fix this warning in XCode9+, when using .with without using it's result

⚠️ Result of call to 'with' is unused

codecov-io commented 6 years ago

Codecov Report

Merging #57 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #57   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines           9      9           
=====================================
  Hits            9      9
Impacted Files Coverage Δ
Sources/Then/Then.swift 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6c7dd3a...86d6695. Read the comment docs.

devxoul commented 6 years ago

Why do you need to use with() without its result?

domingguss commented 6 years ago

when I need to set properties asynchronously - in a block, to update the UI

I know it’s a misuse of ‘inout’, but since XCode9 is stricter I needed this..

devxoul commented 6 years ago

You may use do() in that case.