8000 Corrected Show instance for ServerVersion · postgres-haskell/postgres-wire@22f4d6f · GitHub
[go: up one dir, main page]

Skip to content

Commit 22f4d6f

Browse files
Corrected Show instance for ServerVersion
1 parent 99891d1 commit 22f4d6f

File tree

1 file changed

+3
-2
lines changed
  • src/Database/PostgreSQL/Protocol

1 file changed

+3
-2
lines changed

src/Database/PostgreSQL/Protocol/Types.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Database.PostgreSQL.Protocol.Types where
1212
import Data.Word (Word32, Word8)
1313
import Data.Int (Int32, Int16)
1414
import Data.Hashable (Hashable)
15-
import Data.ByteString (ByteString)
15+
import Data.ByteString as B(ByteString, null)
1616
import Data.Vector (Vector)
1717

1818
-- Common
@@ -69,7 +69,8 @@ data ServerVersion = ServerVersion Word8 Word8 Word8 ByteString
6969

7070
instance Show ServerVersion where
7171
show (ServerVersion major minor revision desc) =
72-
show major ++ "." ++ show minor ++ "." ++ show revision ++ show desc
72+
"v" ++ show major ++ "." ++ show minor ++ "." ++ show revision
73+
++ if B.null desc then "" else show desc
7374

7475
data TransactionStatus
7576
-- | not in a transaction block

0 commit comments

Comments
 (0)
0