Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Redundant Braces. #2581

Merged
merged 1 commit into from May 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions core/src/main/scala/org/http4s/Credentials.scala
Expand Up @@ -83,10 +83,9 @@ object BasicCredentials {

def unapply(creds: Credentials): Option[(String, String)] =
creds match {
case Credentials.Token(AuthScheme.Basic, token) => {
case Credentials.Token(AuthScheme.Basic, token) =>
val basicCredentials = BasicCredentials(token)
Some((basicCredentials.username, basicCredentials.password))
}
case _ =>
None
}
Expand Down
6 changes: 2 additions & 4 deletions dsl/src/main/scala/org/http4s/dsl/impl/Path.scala
Expand Up @@ -341,12 +341,11 @@ abstract class OptionalQueryParamMatcher[T: QueryParamDecoder: QueryParam]
*
* object FooMatcher extends ValidatingQueryParamDecoderMatcher[Foo]("foo")
* val routes: HttpRoutes.of = {
* case GET -> Root / "closest" :? FooMatcher(fooValue) => {
* case GET -> Root / "closest" :? FooMatcher(fooValue) =>
* fooValue.fold(
* nelE => BadRequest(nelE.toList.map(_.sanitized).mkString("\n")),
* foo => { ... }
* )
* }
* }}}
*/
abstract class ValidatingQueryParamDecoderMatcher[T: QueryParamDecoder](name: String) {
Expand All @@ -371,14 +370,13 @@ abstract class ValidatingQueryParamDecoderMatcher[T: QueryParamDecoder](name: St
* object BarMatcher extends OptionalValidatingQueryParamDecoderMatcher[Bar]("bar")
*
* val routes = HttpRoutes.of {
* case GET -> Root / "closest" :? FooMatcher(fooValue) +& BarMatcher(barValue) => {
* case GET -> Root / "closest" :? FooMatcher(fooValue) +& BarMatcher(barValue) =>
* ^(fooValue, barValue getOrElse 42.right) { (foo, bar) =>
* ...
* }.fold(
* nelE => BadRequest(nelE.toList.map(_.sanitized).mkString("\n")),
* baz => { ... }
* )
* }
* }}}
*/
abstract class OptionalValidatingQueryParamDecoderMatcher[T: QueryParamDecoder](name: String) {
Expand Down
Expand Up @@ -17,12 +17,8 @@ object DefaultHead {
def apply[F[_]: Functor, G[_]](http: Http[F, G])(implicit F: MonoidK[F]): Http[F, G] =
Kleisli { req =>
req.method match {
case Method.HEAD => {
(http <+> headAsTruncatedGet(http))(req)
}
case _ => {
http(req)
}
case Method.HEAD => (http <+> headAsTruncatedGet(http))(req)
case _ => http(req)
}
}

Expand Down
Expand Up @@ -82,13 +82,12 @@ private[authentication] class NonceKeeper(
checkStale()
nonces.get(data) match {
case null => NonceKeeper.StaleReply
case n: Nonce => {
case n: Nonce =>
if (nc > n.nc) {
n.nc = n.nc + 1
NonceKeeper.OKReply
} else
NonceKeeper.BadNCReply
}
}
}
}