summaryrefslogtreecommitdiff
path: root/Kernel/KString.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-08 00:51:39 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-08 01:10:53 +0100
commit79fa9765ca89869d19364143989436d117974c21 (patch)
tree3af62f70127d9217d841047f6b7461351800d1ae /Kernel/KString.cpp
parent7ee10c69264cb278845a1e1b06d5acf2e5e7ddf0 (diff)
downloadserenity-79fa9765ca89869d19364143989436d117974c21.zip
Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T>
We now use AK::Error and AK::ErrorOr<T> in both kernel and userspace! This was a slightly tedious refactoring that took a long time, so it's not unlikely that some bugs crept in. Nevertheless, it does pass basic functionality testing, and it's just real nice to finally see the same pattern in all contexts. :^)
Diffstat (limited to 'Kernel/KString.cpp')
-rw-r--r--Kernel/KString.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/KString.cpp b/Kernel/KString.cpp
index 8a6582c7cd..d20fd6e374 100644
--- a/Kernel/KString.cpp
+++ b/Kernel/KString.cpp
@@ -10,7 +10,7 @@ extern bool g_in_early_boot;
namespace Kernel {
-KResultOr<NonnullOwnPtr<KString>> KString::try_create(StringView string)
+ErrorOr<NonnullOwnPtr<KString>> KString::try_create(StringView string)
{
char* characters = nullptr;
size_t length = string.length();
@@ -28,7 +28,7 @@ NonnullOwnPtr<KString> KString::must_create(StringView string)
return KString::try_create(string).release_value();
}
-KResultOr<NonnullOwnPtr<KString>> KString::try_create_uninitialized(size_t length, char*& characters)
+ErrorOr<NonnullOwnPtr<KString>> KString::try_create_uninitialized(size_t length, char*& characters)
{
size_t allocation_size = sizeof(KString) + (sizeof(char) * length) + sizeof(char);
auto* slot = kmalloc(allocation_size);
@@ -46,7 +46,7 @@ NonnullOwnPtr<KString> KString::must_create_uninitialized(size_t length, char*&
return KString::try_create_uninitialized(length, characters).release_value();
}
-KResultOr<NonnullOwnPtr<KString>> KString::try_clone() const
+ErrorOr<NonnullOwnPtr<KString>> KString::try_clone() const
{
return try_create(view());
}