]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/ETag.hs
code cleanup
[Lucu.git] / Network / HTTP / Lucu / ETag.hs
index 76df18378bf3e48417dddd8c73dc6222b65d5136..d87100095a71e78cafeba5435cdf02c397111b26 100644 (file)
@@ -20,6 +20,7 @@ import Data.Ascii (Ascii, AsciiBuilder)
 import qualified Data.Ascii as A
 import Data.Attoparsec.Char8
 import Data.Monoid.Unicode
+import Network.HTTP.Lucu.Parser
 import Network.HTTP.Lucu.Parser.Http hiding (token)
 import Network.HTTP.Lucu.Utils
 import Prelude.Unicode
@@ -52,15 +53,9 @@ printETag et
 parseETag ∷ Ascii → ETag
 {-# INLINEABLE parseETag #-}
 parseETag str
-    = case parseOnly p $ A.toByteString str of
+    = case parseOnly (finishOff eTag) $ A.toByteString str of
         Right et → et
         Left err → error ("unparsable ETag: " ⧺ A.toString str ⧺ ": " ⧺ err)
-    where
-      p ∷ Parser ETag
-      {-# INLINE p #-}
-      p = do et ← eTag
-             endOfInput
-             return et
 
 -- |This is equivalent to @'ETag' 'False'@. If you want to generate an
 -- ETag from a file, try using