factor out Utility.Aeson.textKey

This commit is contained in:
Joey Hess 2022-03-02 18:24:06 -04:00
parent a314a8dfd0
commit cbd138e042
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 17 additions and 36 deletions

View file

@ -5,7 +5,7 @@
- Licensed under the GNU AGPL version 3 or higher.
-}
{-# LANGUAGE OverloadedStrings, CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module Remote (
Remote,
@ -63,9 +63,6 @@ module Remote (
import Data.Ord
import Data.String
#if MIN_VERSION_aeson(2,0,0)
import qualified Data.Aeson.Key as AK
#endif
import qualified Data.Map as M
import qualified Data.Vector as V
@ -247,12 +244,7 @@ prettyPrintUUIDsWith optfield header descm showval uuidvals = do
, Just ("here", toJSON' $ hereu == u)
, case (optfield, optval) of
(Just field, Just val) -> Just
(
#if MIN_VERSION_aeson(2,0,0)
AK.fromText $
#endif
packString field
, toJSON' val)
(textKey (packString field), toJSON' val)
_ -> Nothing
]