Skip to content

Fix the project's only compiler warning (unused cardID binding) #2

Description

@eliseorobles

Context

A full rebuild of every source and test file emits exactly one warning across the whole project:

Sources/ScanDeckApp/ScanDeckPresentationModel.swift:2775:19: warning: value 'cardID' was defined but never used; consider replacing with boolean test [#no-usage]

One permanent warning trains everyone to ignore the whole channel — which is exactly the channel a new contributor needs to trust. A clean build is the cheapest possible signal that a new warning means something.

What to change

Sources/ScanDeckApp/ScanDeckPresentationModel.swift:2774-2779:

var otherBlockingPairMismatchCount: Int {
    guard let cardID = cardPendingSizeAcceptanceConfirmation else {
        return 0
    }
    ...
}

Replace the binding with a nil test:

guard cardPendingSizeAcceptanceConfirmation != nil else {
    return 0
}

Behaviour is unchanged — the binding is never read.

Leave line 2782 alone. confirmSizeAcceptance() has a visually identical guard let cardID = cardPendingSizeAcceptanceConfirmation and does use it — it passes cardID to the reducer action. Changing that one breaks the operator's per-card size-mismatch override, which invariant #2 depends on.

How to verify

touch Sources/ScanDeckApp/ScanDeckPresentationModel.swift
swift build 2>&1 | grep warning     # should print nothing
swift test -c release               # 251 tests in 29 suites

See CONTRIBUTING.md — branch, run the suite, open a PR against main. No scanner needed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions