mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
remove inject function
This commit is contained in:
@@ -30,10 +30,8 @@ import System.FilePath ( (<.>)
|
|||||||
import System.Posix.Files ( fileSize
|
import System.Posix.Files ( fileSize
|
||||||
, getFileStatus
|
, getFileStatus
|
||||||
)
|
)
|
||||||
import Yesod.Core ( MonadHandler(HandlerSite)
|
import Yesod.Core ( TypedContent
|
||||||
, TypedContent
|
|
||||||
, addHeader
|
, addHeader
|
||||||
, getYesod
|
|
||||||
, notFound
|
, notFound
|
||||||
, respondSource
|
, respondSource
|
||||||
, sendChunkBS
|
, sendChunkBS
|
||||||
@@ -76,11 +74,6 @@ pureLog = liftA2 (*>) ($logInfo . show) pure
|
|||||||
logRet :: ToJSON a => Handler a -> Handler a
|
logRet :: ToJSON a => Handler a -> Handler a
|
||||||
logRet = (>>= liftA2 (*>) ($logInfo . decodeUtf8 . BS.toStrict . encode) pure)
|
logRet = (>>= liftA2 (*>) ($logInfo . decodeUtf8 . BS.toStrict . encode) pure)
|
||||||
|
|
||||||
inject :: MonadHandler m => ReaderT (HandlerSite m) m a -> m a
|
|
||||||
inject action = do
|
|
||||||
env <- getYesod
|
|
||||||
runReaderT action env
|
|
||||||
|
|
||||||
data FileExtension = FileExtension FilePath (Maybe String)
|
data FileExtension = FileExtension FilePath (Maybe String)
|
||||||
instance Show FileExtension where
|
instance Show FileExtension where
|
||||||
show (FileExtension f Nothing ) = f
|
show (FileExtension f Nothing ) = f
|
||||||
|
|||||||
Reference in New Issue
Block a user