core: fix ghc 8.10.7 import

This commit is contained in:
Evgeny Poberezkin
2025-01-12 22:47:24 +00:00
parent 748287b724
commit d287df2640

View File

@@ -37,7 +37,7 @@ import Data.Maybe (fromMaybe, mapMaybe)
import Data.String
import Data.Text (Text)
import qualified Data.Text as T
import Data.Text.Encoding (decodeASCII', decodeLatin1, encodeUtf8)
import Data.Text.Encoding (decodeLatin1, encodeUtf8)
import Data.Time.Clock (UTCTime)
import Data.Type.Equality
import Data.Typeable (Typeable)
@@ -288,7 +288,7 @@ instance StrEncoding ReportReason where
"community" -> pure RRCommunity
"profile" -> pure RRProfile
"other" -> pure RROther
t -> maybe (fail "bad ReportReason") (pure . RRUnknown) $ decodeASCII' t
t -> pure $ RRUnknown $ safeDecodeUtf8 t
instance FromJSON ReportReason where
parseJSON = strParseJSON "ReportReason"