Fix deprecation warnings (#181)

This commit is contained in:
Aditya Manthramurthy 2022-10-04 09:56:38 -07:00 committed by GitHub
parent 7eef9b08ea
commit 0b3a5559fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 8 deletions

View File

@ -4,6 +4,7 @@ Changelog
## Version 1.7.0 -- Unreleased
* Fix data type `EventMessage` to not export partial fields
* Bump up min bound on time dep and fix deprecation warnings.
## Version 1.6.0

View File

@ -118,7 +118,7 @@ common base-settings
, resourcet >= 1.2
, retry
, text >= 1.2
, time >= 1.8
, time >= 1.9
, transformers >= 0.5
, unliftio >= 0.2 && < 0.3
, unliftio-core >= 0.2 && < 0.3

View File

@ -27,6 +27,7 @@ where
import Data.ByteString.Char8 (pack)
import qualified Data.Time as Time
import Data.Time.Format.ISO8601 (iso8601Show)
import Lib.Prelude
-- | Time to expire for a presigned URL. It interpreted as a number of
@ -49,4 +50,4 @@ awsParseTime :: [Char] -> Maybe UTCTime
awsParseTime = Time.parseTimeM False Time.defaultTimeLocale "%Y%m%dT%H%M%SZ"
iso8601TimeFormat :: UTCTime -> [Char]
iso8601TimeFormat = Time.formatTime Time.defaultTimeLocale (Time.iso8601DateFormat $ Just "%T%QZ")
iso8601TimeFormat = iso8601Show

View File

@ -36,16 +36,13 @@ import Data.List (zip4, zip6)
import qualified Data.Text as T
import Data.Text.Read (decimal)
import Data.Time
import Data.Time.Format.ISO8601 (iso8601ParseM)
import Lib.Prelude
import Network.Minio.Data
import Network.Minio.Errors
import Text.XML
import Text.XML.Cursor hiding (bool)
-- | Represent the time format string returned by S3 API calls.
s3TimeFormat :: [Char]
s3TimeFormat = iso8601DateFormat $ Just "%T%QZ"
-- | Helper functions.
uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e
uncurry4 f (a, b, c, d) = f a b c d
@ -57,8 +54,8 @@ uncurry6 f (a, b, c, d, e, g) = f a b c d e g
parseS3XMLTime :: MonadIO m => Text -> m UTCTime
parseS3XMLTime t =
maybe (throwIO $ MErrVXmlParse $ "timestamp parse failure: " <> t) return $
parseTimeM True defaultTimeLocale s3TimeFormat $
T.unpack t
iso8601ParseM $
toString t
parseDecimal :: (MonadIO m, Integral a) => Text -> m a
parseDecimal numStr =