From 513aff6280b11e424fa3e86973ff831ee3a159f1 Mon Sep 17 00:00:00 2001 From: Wynand Badenhorst Date: Thu, 7 Oct 2021 09:59:17 -0400 Subject: [PATCH] Switch to ShortStrings --- Project.toml | 4 ++-- src/TimeZones.jl | 2 +- src/types/fixedtimezone.jl | 8 ++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Project.toml b/Project.toml index 5e2e12643..281e3004e 100644 --- a/Project.toml +++ b/Project.toml @@ -6,19 +6,19 @@ version = "1.6.0" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" Future = "9fa8497b-333b-5362-9e8d-4d0656e87820" -InlineStrings = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3" Mocking = "78c3b35d-d492-501b-9361-3d52fe80e533" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" +ShortStrings = "63221d1c-8677-4ff0-9126-0ff0817b4975" Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [compat] -InlineStrings = "1" Mocking = "0.7" RecipesBase = "0.7, 0.8, 1" +ShortStrings = "0.3" julia = "1" [extras] diff --git a/src/TimeZones.jl b/src/TimeZones.jl index 70b3058c4..8c8848f30 100644 --- a/src/TimeZones.jl +++ b/src/TimeZones.jl @@ -5,7 +5,7 @@ using Printf using Serialization using RecipesBase: RecipesBase, @recipe using Unicode -using InlineStrings: InlineString15 +using ShortStrings: ShortString15 import Dates: TimeZone, UTC diff --git a/src/types/fixedtimezone.jl b/src/types/fixedtimezone.jl index 7b420ec5a..35ac37568 100644 --- a/src/types/fixedtimezone.jl +++ b/src/types/fixedtimezone.jl @@ -30,7 +30,7 @@ const FIXED_TIME_ZONE_REGEX = r""" A `TimeZone` with a constant offset for all of time. """ struct FixedTimeZone <: TimeZone - name::InlineString15 + name::ShortString15 offset::UTCOffset end @@ -72,7 +72,7 @@ UTC+15:45:21 function FixedTimeZone(s::AbstractString) s == "Z" && return UTC_ZERO - m = match(FIXED_TIME_ZONE_REGEX, s) + m = match(FIXED_TIME_ZONE_REGEX, String(s)) m === nothing && throw(ArgumentError("Unrecognized time zone: $s")) coefficient = m[:sign] == "-" ? -1 : 1 @@ -96,7 +96,3 @@ end name(tz::FixedTimeZone) = tz.name rename(tz::FixedTimeZone, name::AbstractString) = FixedTimeZone(name, tz.offset) -function Base.isequal(a::FixedTimeZone, b::FixedTimeZone) - return isequal(a.name, b.name) && isequal(a.offset, b.offset) -end -