From 2fa9ec20bd19b42748350355f29d31ef5f6f13c7 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Tue, 16 Jul 2024 23:45:18 -0600 Subject: [PATCH] LibUnicode: Prefix AK::Duration with AK Namespace --- Tests/LibUnicode/TestTimeZone.cpp | 6 +++--- Userland/Libraries/LibUnicode/TimeZone.cpp | 2 +- Userland/Libraries/LibUnicode/TimeZone.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/LibUnicode/TestTimeZone.cpp b/Tests/LibUnicode/TestTimeZone.cpp index 8124a2aa431..214b7ead4ae 100644 --- a/Tests/LibUnicode/TestTimeZone.cpp +++ b/Tests/LibUnicode/TestTimeZone.cpp @@ -70,7 +70,7 @@ TEST_CASE(resolve_primary_time_zone) using enum Unicode::TimeZoneOffset::InDST; -static void test_offset(StringView time_zone, i64 time, Duration expected_offset, Unicode::TimeZoneOffset::InDST expected_in_dst) +static void test_offset(StringView time_zone, i64 time, AK::Duration expected_offset, Unicode::TimeZoneOffset::InDST expected_in_dst) { auto actual_offset = Unicode::time_zone_offset(time_zone, AK::UnixDateTime::from_seconds_since_epoch(time)); VERIFY(actual_offset.has_value()); @@ -79,9 +79,9 @@ static void test_offset(StringView time_zone, i64 time, Duration expected_offset EXPECT_EQ(actual_offset->in_dst, expected_in_dst); } -static constexpr Duration offset(i64 sign, i64 hours, i64 minutes, i64 seconds) +static constexpr AK::Duration offset(i64 sign, i64 hours, i64 minutes, i64 seconds) { - return Duration::from_seconds(sign * ((hours * 3600) + (minutes * 60) + seconds)); + return AK::Duration::from_seconds(sign * ((hours * 3600) + (minutes * 60) + seconds)); } // Useful website to convert times in the TZDB (which sometimes are and aren't UTC) to UTC and the desired local time: diff --git a/Userland/Libraries/LibUnicode/TimeZone.cpp b/Userland/Libraries/LibUnicode/TimeZone.cpp index 4941c73d1e7..5269c4fa899 100644 --- a/Userland/Libraries/LibUnicode/TimeZone.cpp +++ b/Userland/Libraries/LibUnicode/TimeZone.cpp @@ -134,7 +134,7 @@ Optional time_zone_offset(StringView time_zone, UnixDateTime tim return {}; return TimeZoneOffset { - .offset = Duration::from_milliseconds(raw_offset + dst_offset), + .offset = AK::Duration::from_milliseconds(raw_offset + dst_offset), .in_dst = dst_offset == 0 ? TimeZoneOffset::InDST::No : TimeZoneOffset::InDST::Yes, }; } diff --git a/Userland/Libraries/LibUnicode/TimeZone.h b/Userland/Libraries/LibUnicode/TimeZone.h index 6a6b6469a39..41578b72705 100644 --- a/Userland/Libraries/LibUnicode/TimeZone.h +++ b/Userland/Libraries/LibUnicode/TimeZone.h @@ -19,7 +19,7 @@ struct TimeZoneOffset { Yes, }; - Duration offset; + AK::Duration offset; InDST in_dst { InDST::No }; };