1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:27:43 +00:00

Everywhere: Avoid calling from_utf8 on FlyString or String

We already have a String :^)
This commit is contained in:
Shannon Booth 2023-12-09 09:24:41 +13:00 committed by Andreas Kling
parent 55ec1cbfb5
commit 6ce0d588ee
6 changed files with 18 additions and 30 deletions

View file

@ -131,7 +131,7 @@ ErrorOr<void> DeviceEventLoop::register_new_device(DeviceNodeFamily::Type unix_d
}
auto allocated_suffix_index = possible_allocated_suffix_index.release_value();
auto path = TRY(String::from_utf8(path_pattern));
auto path = path_pattern;
if (match.path_pattern.contains("%digit"sv)) {
auto replacement = TRY(build_suffix_with_numbers(allocated_suffix_index));
path = TRY(path.replace("%digit"sv, replacement, ReplaceMode::All));