From 85c49a8af9aed6e26604ea6756ed783b6ca9ee90 Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Sun, 9 Feb 2020 23:50:48 -0500 Subject: [PATCH] Simplify mockedSystemInterface --- src/ShellCheck/Interface.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ShellCheck/Interface.hs b/src/ShellCheck/Interface.hs index aa12fc2..e51359e 100644 --- a/src/ShellCheck/Interface.hs +++ b/src/ShellCheck/Interface.hs @@ -316,10 +316,10 @@ mockedSystemInterface files = SystemInterface { siGetConfig = const $ return Nothing } where - rf file = - case filter ((== file) . fst) files of - [] -> return $ Left "File not included in mock." - [(_, contents)] -> return $ Right contents + rf file = return $ + case find ((== file) . fst) files of + Nothing -> Left "File not included in mock." + Just (_, contents) -> Right contents fs _ _ file = return file mockRcFile rcfile mock = mock {