Skip to content

Commit

Permalink
Add missing guard keyword (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzsternemann authored Nov 9, 2023
1 parent 3c7f440 commit d7fb66e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion documentation/Router.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ You can extract parameters out of the URI by prefixing the path with a colon. Th
```swift
let app = HBApplication()
app.router.get("/user/:id") { request in
let id = request.parameters.get("id", as: Int.self) else { throw HBHTTPError(.badRequest) }
guard let id = request.parameters.get("id", as: Int.self) else { throw HBHTTPError(.badRequest) }
return getUser(id: id)
}
```
Expand Down

0 comments on commit d7fb66e

Please sign in to comment.