summaryrefslogtreecommitdiff
path: root/Userland/Utilities
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/Utilities
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/Utilities')
-rw-r--r--Userland/Utilities/du.cpp2
-rw-r--r--Userland/Utilities/matroska.cpp2
-rw-r--r--Userland/Utilities/pls.cpp2
-rw-r--r--Userland/Utilities/strace.cpp2
4 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Utilities/du.cpp b/Userland/Utilities/du.cpp
index 68ab071a60..f5abd7297e 100644
--- a/Userland/Utilities/du.cpp
+++ b/Userland/Utilities/du.cpp
@@ -128,7 +128,7 @@ ErrorOr<off_t> print_space_usage(String const& path, DuOption const& du_option,
auto di = Core::DirIterator(path, Core::DirIterator::SkipParentAndBaseDir);
if (di.has_error()) {
outln("du: cannot read directory '{}': {}", path, di.error_string());
- return Error::from_string_literal("An error occurred. See previous error."sv);
+ return Error::from_string_literal("An error occurred. See previous error.");
}
while (di.has_next()) {
diff --git a/Userland/Utilities/matroska.cpp b/Userland/Utilities/matroska.cpp
index 061078ca42..d3630ca650 100644
--- a/Userland/Utilities/matroska.cpp
+++ b/Userland/Utilities/matroska.cpp
@@ -11,7 +11,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
{
auto document = Video::MatroskaReader::parse_matroska_from_file("/home/anon/Videos/test-webm.webm");
if (!document) {
- return Error::from_string_literal("Failed to parse :("sv);
+ return Error::from_string_literal("Failed to parse :(");
}
outln("DocType is {}", document->header().doc_type.characters());
diff --git a/Userland/Utilities/pls.cpp b/Userland/Utilities/pls.cpp
index c27991a1f4..4912a30fab 100644
--- a/Userland/Utilities/pls.cpp
+++ b/Userland/Utilities/pls.cpp
@@ -36,7 +36,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (account.has_password()) {
auto password = TRY(Core::get_password());
if (!account.authenticate(password))
- return Error::from_string_literal("Incorrect or disabled password."sv);
+ return Error::from_string_literal("Incorrect or disabled password.");
}
}
diff --git a/Userland/Utilities/strace.cpp b/Userland/Utilities/strace.cpp
index 37e9f4645d..2d650063da 100644
--- a/Userland/Utilities/strace.cpp
+++ b/Userland/Utilities/strace.cpp
@@ -848,7 +848,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
int status;
if (g_pid == -1) {
if (child_argv.is_empty())
- return Error::from_string_literal("Expected either a pid or some arguments"sv);
+ return Error::from_string_literal("Expected either a pid or some arguments");
auto pid = TRY(Core::System::fork());