1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

LibWeb: Port CSS::UnicodeRange to new Strings

This commit is contained in:
Sam Atkins 2023-02-14 19:55:40 +00:00 committed by Tim Flynn
parent 316092d185
commit fc3540c4b1
3 changed files with 8 additions and 8 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -7,7 +7,7 @@
#pragma once
#include <AK/Assertions.h>
#include <AK/DeprecatedString.h>
#include <AK/String.h>
namespace Web::CSS {
@ -29,11 +29,11 @@ public:
return m_min_code_point <= code_point && code_point <= m_max_code_point;
}
DeprecatedString to_deprecated_string() const
ErrorOr<String> to_string() const
{
if (m_min_code_point == m_max_code_point)
return DeprecatedString::formatted("U+{:x}", m_min_code_point);
return DeprecatedString::formatted("U+{:x}-{:x}", m_min_code_point, m_max_code_point);
return String::formatted("U+{:x}", m_min_code_point);
return String::formatted("U+{:x}-{:x}", m_min_code_point, m_max_code_point);
}
private: