summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCore/Account.cpp
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/LibCore/Account.cpp
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/LibCore/Account.cpp')
-rw-r--r--Userland/Libraries/LibCore/Account.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibCore/Account.cpp b/Userland/Libraries/LibCore/Account.cpp
index eeab247d5d..77ce8e6efd 100644
--- a/Userland/Libraries/LibCore/Account.cpp
+++ b/Userland/Libraries/LibCore/Account.cpp
@@ -73,14 +73,14 @@ ErrorOr<Account> Account::self([[maybe_unused]] Read options)
auto pwd = TRY(Core::System::getpwuid(getuid()));
if (!pwd.has_value())
- return Error::from_string_literal("No such user"sv);
+ return Error::from_string_literal("No such user");
spwd spwd = {};
#ifndef AK_OS_BSD_GENERIC
if (options != Read::PasswdOnly) {
auto maybe_spwd = TRY(Core::System::getspnam({ pwd->pw_name, strlen(pwd->pw_name) }));
if (!maybe_spwd.has_value())
- return Error::from_string_literal("No shadow entry for user"sv);
+ return Error::from_string_literal("No shadow entry for user");
spwd = maybe_spwd.release_value();
}
#endif
@@ -92,14 +92,14 @@ ErrorOr<Account> Account::from_name(char const* username, [[maybe_unused]] Read
{
auto pwd = TRY(Core::System::getpwnam({ username, strlen(username) }));
if (!pwd.has_value())
- return Error::from_string_literal("No such user"sv);
+ return Error::from_string_literal("No such user");
spwd spwd = {};
#ifndef AK_OS_BSD_GENERIC
if (options != Read::PasswdOnly) {
auto maybe_spwd = TRY(Core::System::getspnam({ pwd->pw_name, strlen(pwd->pw_name) }));
if (!maybe_spwd.has_value())
- return Error::from_string_literal("No shadow entry for user"sv);
+ return Error::from_string_literal("No shadow entry for user");
spwd = maybe_spwd.release_value();
}
#endif
@@ -110,14 +110,14 @@ ErrorOr<Account> Account::from_uid(uid_t uid, [[maybe_unused]] Read options)
{
auto pwd = TRY(Core::System::getpwuid(uid));
if (!pwd.has_value())
- return Error::from_string_literal("No such user"sv);
+ return Error::from_string_literal("No such user");
spwd spwd = {};
#ifndef AK_OS_BSD_GENERIC
if (options != Read::PasswdOnly) {
auto maybe_spwd = TRY(Core::System::getspnam({ pwd->pw_name, strlen(pwd->pw_name) }));
if (!maybe_spwd.has_value())
- return Error::from_string_literal("No shadow entry for user"sv);
+ return Error::from_string_literal("No shadow entry for user");
spwd = maybe_spwd.release_value();
}
#endif