Skip to content

Silence unused result warnings for refresh outcome methods - #139

Merged
austin-smith merged 1 commit into
mainfrom
discardable-result-refresh-outcomes
Aug 12, 2026
Merged

Silence unused result warnings for refresh outcome methods#139
austin-smith merged 1 commit into
mainfrom
discardable-result-refresh-outcomes

Conversation

@austin-smith

Copy link
Copy Markdown
Owner

What Changed

Marked five RefreshOutcome-returning methods @discardableResult:

  • TransmissionStore.refreshNow() and TransmissionStore.performFullRefresh(for:)
  • The Binding-based load(for:using:showingError:errorMessage:) and loadIfIdle(for:using:showingError:errorMessage:) wrappers on TorrentDetailSupplementalStore

Also removed the now-redundant _ = discard in TransmissionStore.requestRefresh().

Why

Xcode reported six "Result of call to '…' is unused" warnings across macOSContentView, macOSTorrentDetail, and TransmissionStore. These methods exist primarily for their side effects and surface errors internally via onError handlers and error bindings, so most call sites legitimately ignore the returned RefreshOutcome. Per SE-0047's guidance (and the SE-0520 precedent that made Task initializers discardable for fire-and-forget use), the API author should annotate such methods rather than sprinkle _ = at every call site. Callers that want the outcome — iOS pull-to-refresh haptics and the test suite — still receive it.

The core onError-variant load/loadIfIdle on TorrentDetailSupplementalStore remain unannotated since their callers all consume the result, keeping the warning as a guardrail there.

Validation

  • BitDreamAppStore Debug macOS build is clean: all six warnings resolved, no new warnings
  • Full macOS test suite (BitDream scheme) passes: ** TEST SUCCEEDED **
  • swiftlint lint --quiet reports no violations

refreshNow, performFullRefresh, and the binding-based load/loadIfIdle
wrappers exist primarily for their side effects and surface errors
internally, so most call sites ignore the returned RefreshOutcome.
annotating them silences six unused-result warnings while callers that
want the outcome (ios pull-to-refresh haptics, tests) still receive it.
@austin-smith
austin-smith merged commit 1a0ae74 into main Aug 12, 2026
3 checks passed
@austin-smith
austin-smith deleted the discardable-result-refresh-outcomes branch August 12, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant