Skip to content

Commit

Permalink
[first_where] Make triggering example valid Swift code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Feb 14, 2019
1 parent ae6c2fb commit 905ea08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -7596,7 +7596,7 @@ realm?.objects(User.self).filter(NSPredicate(format: "email ==[c] %@", email)).f
```

```swift
} else if let pause = timeTracker.pauses.filter("beginDate < %@", beginDate).first {
if let pause = timeTracker.pauses.filter("beginDate < %@", beginDate).first { print(pause) }
```

</details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public struct FirstWhereRule: CallPairRule, OptInRule, ConfigurationProviderRule
"(myList.filter { $0 == 1 }.suffix(2)).first\n",
"collection.filter(\"stringCol = '3'\").first",
"realm?.objects(User.self).filter(NSPredicate(format: \"email ==[c] %@\", email)).first",
"} else if let pause = timeTracker.pauses.filter(\"beginDate < %@\", beginDate).first {"
"if let pause = timeTracker.pauses.filter(\"beginDate < %@\", beginDate).first { print(pause) }"
],
triggeringExamples: [
"↓myList.filter { $0 % 2 == 0 }.first\n",
Expand Down

0 comments on commit 905ea08

Please sign in to comment.