stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.67k stars 1.56k forks source link

Add @discardableResult to all FTSConfig methods returning Self for chaining #950

Closed guillaumealgis closed 3 years ago

guillaumealgis commented 5 years ago

Hi,

This fixes the compiler warnings when using the FTSConfig* classes without chaining the methods calls.

For example this works fine :

let config = FTS5Config()
    .column(subject)
    .column(body, [.unindexed])
    .prefix([2, 3])

But this emits a warning (but shouldn't because the first version is just syntaxic sugar and the semantics are the same here) :

let config = FTS5Config()
config.column(subject)
config.column(body, [.unindexed])
config.prefix([2, 3]) // warning: Result of call to 'prefix' is unused

This PR adresses this issue by adding @discardableResult to all methods of the FTSConfig* classes returning Self.