Shorten two lines of code to one
This commit is contained in:
parent
93a4378475
commit
edab8835ad
1 changed files with 1 additions and 2 deletions
|
@ -45,8 +45,7 @@ serverT = handleLanguages :<|> handleEval
|
|||
handleEval :: EvalRequest -> MyriadT m EvalResponse
|
||||
handleEval EvalRequest { language, code } = do
|
||||
logInfoN $ mconcat ["POST /eval"]
|
||||
env <- ask
|
||||
let MyriadConfig { languages } = config env
|
||||
MyriadConfig { languages } <- asks config
|
||||
case find (\x -> name x == language) languages of
|
||||
Nothing -> throwError $ err404 { errBody = "Language " <> cvs language <> " was not found" }
|
||||
Just cfg -> do
|
||||
|
|
Loading…
Reference in a new issue