Skip to content

Commit

Permalink
remove discardableResult
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed Jun 1, 2016
1 parent 38bdacd commit eb2285b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Sources/Query.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class Query<T: Model> {

Returns an array of entities.
*/
@discardableResult
// @discardableResult
func run() throws -> [T] {
var models: [T] = []

Expand Down Expand Up @@ -121,7 +121,7 @@ public class Query<T: Model> {
let data = model.serialize()

if let id = model.id {
filter(database.driver.idKey, .equals, id)
let _ = filter(database.driver.idKey, .equals, id) // discardableResult
try update(data)
} else {
let new = try create(data)
Expand All @@ -137,7 +137,7 @@ public class Query<T: Model> {
*/
public func delete() throws {
action = .delete
try run()
let _ = try run() // discardableResult
}

/**
Expand All @@ -153,7 +153,7 @@ public class Query<T: Model> {
let filter = Filter.compare(database.driver.idKey, .equals, id)
filters.append(filter)

try run()
let _ = try run() // discardableResult
}

//MARK: Update
Expand All @@ -165,7 +165,7 @@ public class Query<T: Model> {
public func update(_ serialized: [String: Value?]) throws {
action = .update
data = serialized
try run()
let _ = try run() // discardableResult
}


Expand All @@ -178,7 +178,7 @@ public class Query<T: Model> {
Used for filtering results based on how
a result's value compares to the supplied value.
*/
@discardableResult
// @discardableResult
public func filter(_ field: String, _ comparison: Filter.Comparison, _ value: Value) -> Self {
let filter = Filter.compare(field, comparison, value)
filters.append(filter)
Expand All @@ -192,7 +192,7 @@ public class Query<T: Model> {
Used for filtering results based on whether
a result's value is or is not in a set.
*/
@discardableResult
// @discardableResult
public func filter(_ field: String, _ scope: Filter.Scope, _ set: [Value]) -> Self {
let filter = Filter.subset(field, scope, set)
filters.append(filter)
Expand All @@ -203,7 +203,7 @@ public class Query<T: Model> {
/**
Shortcut for creating a `.equals` filter.
*/
@discardableResult
// @discardableResult
public func filter(_ field: String, _ value: Value) -> Self {
return filter(field, .equals, value)
}
Expand Down

0 comments on commit eb2285b

Please sign in to comment.