From d287df2640d6f7db94fc9a58da88bb36ebea0edb Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Sun, 12 Jan 2025 22:47:24 +0000 Subject: [PATCH] core: fix ghc 8.10.7 import --- src/Simplex/Chat/Protocol.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Simplex/Chat/Protocol.hs b/src/Simplex/Chat/Protocol.hs index 577cb6293d..bc6b083964 100644 --- a/src/Simplex/Chat/Protocol.hs +++ b/src/Simplex/Chat/Protocol.hs @@ -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"