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

Kernel: Remove the KString::try_create(String::formatted(...)) pattern

We can now directly create formatted KStrings with KString::formatted.

:^)
This commit is contained in:
Daniel Bertalan 2021-12-28 09:38:41 +01:00 committed by Brian Gianforcaro
parent 7d6058415e
commit 52beeebe70
11 changed files with 18 additions and 35 deletions

View file

@ -16,7 +16,7 @@ namespace Kernel {
NonnullRefPtr<SysFSDeviceComponent> SysFSDeviceComponent::must_create(Device const& device)
{
// FIXME: Handle allocation failure gracefully
auto device_name = MUST(KString::try_create(String::formatted("{}:{}", device.major(), device.minor())));
auto device_name = MUST(KString::formatted("{}:{}", device.major(), device.minor()));
return adopt_ref_if_nonnull(new SysFSDeviceComponent(move(device_name), device)).release_nonnull();
}
SysFSDeviceComponent::SysFSDeviceComponent(NonnullOwnPtr<KString> major_minor_formatted_device_name, Device const& device)