Permalink
Browse files

! httpx: remove MetaUnmarshallers.scala, fold only member into FormDa…

…taUnmarshallers.scala
  • Loading branch information...
sirthias committed Sep 30, 2013
1 parent ef03bf4 commit ebe3e976df10662c818b19465bd3a6f0856f038d
@@ -31,7 +31,6 @@ trait Deserializer[A, B] extends (A ⇒ Deserialized[B]) { self ⇒
object Deserializer extends DeserializerLowerPriorityImplicits
with BasicUnmarshallers
- with MetaUnmarshallers
with FromStringDeserializers
with FormDataUnmarshallers {
@@ -113,6 +113,17 @@ trait FormDataUnmarshallers {
throw new IllegalArgumentException(ex.info.formatPretty.replace("Query,", "form content,"))
}
}
+
+ implicit def formUnmarshaller(implicit fdum: Unmarshaller[FormData], mpfdum: Unmarshaller[MultipartFormData]) =
+ new Unmarshaller[HttpForm] {
+ def apply(entity: HttpEntity) = fdum(entity).left.flatMap {
+ case UnsupportedContentType(error1) ⇒ mpfdum(entity).left.map {
+ case UnsupportedContentType(error2) ⇒ UnsupportedContentType(error1 + " or " + error2)
+ case error ⇒ error
+ }
+ case error ⇒ Left(error)
+ }
+ }
}
object FormDataUnmarshallers extends FormDataUnmarshallers
@@ -1,36 +0,0 @@
-/*
- * Copyright © 2011-2013 the spray project <http://spray.io>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package spray.httpx.unmarshalling
-
-import spray.http._
-
-trait MetaUnmarshallers {
-
- implicit def formUnmarshaller(implicit fdum: Unmarshaller[FormData], mpfdum: Unmarshaller[MultipartFormData]) =
- new Unmarshaller[HttpForm] {
- def apply(entity: HttpEntity) = fdum(entity).left.flatMap {
- case UnsupportedContentType(error1) mpfdum(entity).left.map {
- case UnsupportedContentType(error2) UnsupportedContentType(error1 + " or " + error2)
- case error error
- }
- case error Left(error)
- }
- }
-
-}
-
-object MetaUnmarshallers extends MetaUnmarshallers

0 comments on commit ebe3e97

Please sign in to comment.