From 649552ae69615fe9c5d88883768e13a32d4e1b9c Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
Date: Tue, 25 Jul 2017 13:02:15 +0530
Subject: [PATCH] Metainfo: rename mkInfo -> bvalToInfo

---
 src/FuncTorrent/Metainfo.hs | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/FuncTorrent/Metainfo.hs b/src/FuncTorrent/Metainfo.hs
index e555074..4cc6ed1 100644
--- a/src/FuncTorrent/Metainfo.hs
+++ b/src/FuncTorrent/Metainfo.hs
@@ -50,24 +50,24 @@ data Metainfo = Metainfo { info :: !(Maybe Info)
                          , infoHash :: !ByteString
                          } deriving (Eq, Show)
 
-mkInfo :: BVal -> Maybe Info
-mkInfo (Bdict m) = let (Bint pieceLength') = m ! "piece length"
-                       (Bstr pieces') = m ! "pieces"
-                       private' = Nothing
-                       (Bstr name') = m ! "name"
-                       (Bint length') = m ! "length"
-                       md5sum' = Nothing
-                   in Just Info { pieceLength = pieceLength'
-                                , pieces = pieces'
-                                , private = private'
-                                , name = unpack name'
-                                , lengthInBytes = length'
-                                , md5sum = md5sum'}
-mkInfo _ = Nothing
+bvalToInfo :: BVal -> Maybe Info
+bvalToInfo (Bdict m) = let (Bint pieceLength') = m ! "piece length"
+                           (Bstr pieces') = m ! "pieces"
+                           private' = Nothing
+                           (Bstr name') = m ! "name"
+                           (Bint length') = m ! "length"
+                           md5sum' = Nothing
+                       in Just Info { pieceLength = pieceLength'
+                                    , pieces = pieces'
+                                    , private = private'
+                                    , name = unpack name'
+                                    , lengthInBytes = length'
+                                    , md5sum = md5sum'}
+bvalToInfo _ = Nothing
 
 mkMetaInfo :: BVal   -> Either String Metainfo
 mkMetaInfo (Bdict m)  =
-    let info'         = mkInfo $ m ! "info"
+    let info'         = bvalToInfo $ m ! "info"
         announce'     = lookup "announce" m
         announceList' = lookup "announce-list" m
         creationDate' = lookup "creation date" m
-- 
2.45.2