mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 07:41:01 +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:
parent
7d6058415e
commit
52beeebe70
Notes:
sideshowbarker
2024-07-17 22:04:04 +09:00
Author: https://github.com/BertalanD
Commit: 52beeebe70
Pull-request: https://github.com/SerenityOS/serenity/pull/11461
11 changed files with 18 additions and 35 deletions
|
@ -103,10 +103,7 @@ void VirtualConsole::set_graphical(bool graphical)
|
|||
|
||||
UNMAP_AFTER_INIT NonnullRefPtr<VirtualConsole> VirtualConsole::create(size_t index)
|
||||
{
|
||||
// FIXME: Don't make a temporary String here
|
||||
auto pts_name_or_error = KString::try_create(String::formatted("/dev/tty/{}", index));
|
||||
VERIFY(!pts_name_or_error.is_error());
|
||||
auto pts_name = pts_name_or_error.release_value();
|
||||
auto pts_name = MUST(KString::formatted("/dev/tty/{}", index));
|
||||
|
||||
auto virtual_console_or_error = DeviceManagement::try_create_device<VirtualConsole>(index, move(pts_name));
|
||||
// FIXME: Find a way to propagate errors
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue