summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
authorsin-ack <sin-ack@users.noreply.github.com>2022-07-11 17:57:32 +0000
committerAndreas Kling <kling@serenityos.org>2022-07-12 23:11:35 +0200
commite5f09ea1703bacfbb79a4ad3c587a7d5d3d7bb13 (patch)
tree6d90ea8a795e90f19f907a225c1ea166de960930 /Userland/Libraries/LibGUI
parentc70f45ff4498fcb7ce0671e9107ecff8009d7eb2 (diff)
downloadserenity-e5f09ea1703bacfbb79a4ad3c587a7d5d3d7bb13.zip
Everywhere: Split Error::from_string_literal and Error::from_string_view
Error::from_string_literal now takes direct char const*s, while Error::from_string_view does what Error::from_string_literal used to do: taking StringViews. This change will remove the need to insert `sv` after error strings when returning string literal errors once StringView(char const*) is removed. No functional changes.
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r--Userland/Libraries/LibGUI/GML/Parser.cpp12
-rw-r--r--Userland/Libraries/LibGUI/Icon.cpp2
2 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibGUI/GML/Parser.cpp b/Userland/Libraries/LibGUI/GML/Parser.cpp
index 7324eb8aee..270bf984dd 100644
--- a/Userland/Libraries/LibGUI/GML/Parser.cpp
+++ b/Userland/Libraries/LibGUI/GML/Parser.cpp
@@ -32,12 +32,12 @@ static ErrorOr<NonnullRefPtr<Object>> parse_gml_object(Queue<Token>& tokens)
TRY(object->add_property_child(TRY(Node::from_token<Comment>(tokens.dequeue()))));
if (peek() != Token::Type::ClassMarker)
- return Error::from_string_literal("Expected class marker"sv);
+ return Error::from_string_literal("Expected class marker");
tokens.dequeue();
if (peek() != Token::Type::ClassName)
- return Error::from_string_literal("Expected class name"sv);
+ return Error::from_string_literal("Expected class name");
auto class_name = tokens.dequeue();
object->set_name(class_name.m_view);
@@ -69,10 +69,10 @@ static ErrorOr<NonnullRefPtr<Object>> parse_gml_object(Queue<Token>& tokens)
auto property_name = tokens.dequeue();
if (property_name.m_view.is_empty())
- return Error::from_string_literal("Expected non-empty property name"sv);
+ return Error::from_string_literal("Expected non-empty property name");
if (peek() != Token::Type::Colon)
- return Error::from_string_literal("Expected ':'"sv);
+ return Error::from_string_literal("Expected ':'");
tokens.dequeue();
@@ -87,7 +87,7 @@ static ErrorOr<NonnullRefPtr<Object>> parse_gml_object(Queue<Token>& tokens)
} else if (peek() == Token::Type::Comment) {
pending_comments.append(TRY(Node::from_token<Comment>(tokens.dequeue())));
} else {
- return Error::from_string_literal("Expected child, property, comment, or }}"sv);
+ return Error::from_string_literal("Expected child, property, comment, or }}");
}
}
@@ -96,7 +96,7 @@ static ErrorOr<NonnullRefPtr<Object>> parse_gml_object(Queue<Token>& tokens)
TRY(object->add_sub_object_child(pending_comments.take_first()));
if (peek() != Token::Type::RightCurly)
- return Error::from_string_literal("Expected }}"sv);
+ return Error::from_string_literal("Expected }}");
tokens.dequeue();
}
diff --git a/Userland/Libraries/LibGUI/Icon.cpp b/Userland/Libraries/LibGUI/Icon.cpp
index 35b497539a..bdbb3de8a9 100644
--- a/Userland/Libraries/LibGUI/Icon.cpp
+++ b/Userland/Libraries/LibGUI/Icon.cpp
@@ -89,7 +89,7 @@ ErrorOr<Icon> Icon::try_create_default_icon(StringView name)
if (!bitmap16 && !bitmap32) {
dbgln("Default icon not found: {}", name);
- return Error::from_string_literal("Default icon not found"sv);
+ return Error::from_string_literal("Default icon not found");
}
return Icon(move(bitmap16), move(bitmap32));