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

Userland: Don't use String::from_utf8() for literal strings

This commit is contained in:
Tim Ledbetter 2023-09-14 17:57:11 +01:00 committed by Andreas Kling
parent 4cc3c41269
commit c74f7e5f2a
8 changed files with 15 additions and 15 deletions

View file

@ -26,7 +26,7 @@ ErrorOr<HashMap<String, InstalledPort>> InstalledPort::read_ports_database()
auto type = InstalledPort::Type::Dependency;
// FIXME: Add versioning when printing these ports!
auto name = TRY(String::from_utf8(parts[2]));
TRY(ports.try_set(name, InstalledPort { TRY(String::from_utf8(parts[2])), type, TRY(String::from_utf8(""sv)) }));
TRY(ports.try_set(name, InstalledPort { TRY(String::from_utf8(parts[2])), type, {} }));
} else if (line.starts_with("auto"sv)) {
auto parts = line.split_view(' ');
VERIFY(parts.size() == 3);