]> git.rkrishnan.org Git - functorrent.git/blobdiff - src/FuncTorrent/Utils.hs
fix hlint suggestions
[functorrent.git] / src / FuncTorrent / Utils.hs
index 48ebe67710d81258b9600c874dec3de414d52cf5..b1db8d0defcbf9d6b1c9f46ec520448369b90b19 100644 (file)
@@ -11,6 +11,7 @@ module FuncTorrent.Utils
 import Prelude hiding (writeFile, take)
 
 import qualified Crypto.Hash.SHA1 as SHA1 (hash)
+import Control.Monad (unless)
 import Data.ByteString (ByteString, writeFile, hPut, hGet, take)
 import qualified Data.ByteString.Char8 as BC
 import System.IO (withFile, hSeek, IOMode(..), SeekMode(..))
@@ -28,9 +29,7 @@ splitNum n d | n == 0 = []
 createDummyFile :: FilePath -> Int -> IO ()
 createDummyFile path size = do
   dfe <- doesFileExist path
-  if dfe
-    then return ()
-    else
+  unless dfe $
     writeFile path (BC.replicate size '\0')
 
 -- write into a file at a specific offet