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

Userland: Prefer _short_string over String::from_utf8_short_string

This user-defined literal is a strictly equivalent but shorter alias to
`String::from_utf8_short_string`.
This commit is contained in:
Lucas CHOLLET 2023-08-07 22:01:45 -04:00 committed by Andreas Kling
parent 66645cdc94
commit a5edc9cdfc
7 changed files with 8 additions and 8 deletions

View file

@ -60,7 +60,7 @@ ErrorOr<void> BackgroundSettingsWidget::create_frame()
m_wallpaper_view->set_model(GUI::FileSystemModel::create("/res/wallpapers"));
m_wallpaper_view->set_model_column(GUI::FileSystemModel::Column::Name);
m_wallpaper_view->on_selection_change = [this] {
String path = String::from_utf8_short_string(""sv);
String path;
if (!m_wallpaper_view->selection().is_empty()) {
auto index = m_wallpaper_view->selection().first();
auto path_or_error = String::from_deprecated_string(static_cast<GUI::FileSystemModel*>(m_wallpaper_view->model())->full_path(index));