Skip to content

Commit

Permalink
Switch to ShortStrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Wynand committed Oct 7, 2021
1 parent 5b24406 commit 513aff6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/TimeZones.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using Printf
using Serialization
using RecipesBase: RecipesBase, @recipe
using Unicode
using InlineStrings: InlineString15
using ShortStrings: ShortString15

import Dates: TimeZone, UTC

Expand Down
8 changes: 2 additions & 6 deletions src/types/fixedtimezone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit 513aff6

Please sign in to comment.