]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/MIMEType.hs
code cleanup
[Lucu.git] / Network / HTTP / Lucu / MIMEType.hs
index ab0e06596320d343164211017a8725ada3b9f07b..1aebc9f56b1233b34a75384d6a45db7441125b7c 100644 (file)
@@ -22,6 +22,7 @@ import Data.Attoparsec.Char8 as P
 import Data.Map (Map)
 import Data.Monoid.Unicode
 import Data.Text (Text)
+import Network.HTTP.Lucu.Parser
 import Network.HTTP.Lucu.Parser.Http
 import Network.HTTP.Lucu.RFC2231
 import Prelude hiding (min)
@@ -59,15 +60,9 @@ printMIMEType (MIMEType maj min params)
 parseMIMEType ∷ Ascii → MIMEType
 {-# INLINEABLE parseMIMEType #-}
 parseMIMEType str
-    = case parseOnly p $ A.toByteString str of
+    = case parseOnly (finishOff mimeType) $ A.toByteString str of
         Right  t → t
         Left err → error ("unparsable MIME Type: " ⧺ A.toString str ⧺ ": " ⧺ err)
-    where
-      p ∷ Parser MIMEType
-      {-# INLINE p #-}
-      p = do t ← mimeType
-             endOfInput
-             return t
 
 -- |'Parser' for an 'MIMEType'.
 mimeType ∷ Parser MIMEType