diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-08-20 15:54:43 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-08-20 15:54:43 +0300 |
commit | 87ae152b71317b99bcbeeab80145ae1f3cf22d83 (patch) | |
tree | 0ba746abfb44730f07cf7681f90e6340cfaa0a9b /src/Windows | |
parent | list_path: no weird symbols in output (diff) | |
download | windows-env-87ae152b71317b99bcbeeab80145ae1f3cf22d83.tar.gz windows-env-87ae152b71317b99bcbeeab80145ae1f3cf22d83.zip |
fix HLint warnings
Diffstat (limited to '')
-rw-r--r-- | src/Windows/Registry.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Windows/Registry.hs b/src/Windows/Registry.hs index a8504d6..6661177 100644 --- a/src/Windows/Registry.hs +++ b/src/Windows/Registry.hs @@ -25,6 +25,7 @@ module Windows.Registry , setString ) where +import Control.Monad (unless) import Data.List (intercalate) import Data.List.Split (splitOn) import Foreign.ForeignPtr (withForeignPtr) @@ -76,7 +77,7 @@ raiseDoesNotExistError functionName = ioError $ mkIOError doesNotExistErrorType functionName Nothing Nothing raiseUnknownError :: String -> WinAPI.ErrCode -> IO a -raiseUnknownError functionName exitCode = WinAPI.failWith functionName exitCode +raiseUnknownError = WinAPI.failWith exitCodeSuccess :: WinAPI.ErrCode exitCodeSuccess = 0 @@ -94,9 +95,8 @@ delValue keyHandle valueName = withForeignPtr keyHandle $ \keyPtr -> WinAPI.withTString valueName $ \valueNamePtr -> do ret <- WinAPI.c_RegDeleteValue keyPtr valueNamePtr - if ret == exitCodeSuccess - then return () - else raiseError "RegDeleteValue" ret + unless (ret == exitCodeSuccess) $ + raiseError "RegDeleteValue" ret type ValueType = WinAPI.RegValueType |