Skip to content

Commit 2483cf4

Browse files
committed
db_completion: initialize std::string from std::string_view
1 parent 2f68700 commit 2483cf4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/db_completion.cxx

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ gcmp_list_from_path(struct mpdclient &c, const char *path,
2929
types & GCMP_TYPE_DIR) {
3030
const struct mpd_directory *dir =
3131
mpd_entity_get_directory(entity);
32-
name = Utf8ToLocale(mpd_directory_get_path(dir)).c_str();
32+
name = Utf8ToLocale{mpd_directory_get_path(dir)};
3333
name.push_back('/');
3434
} else if (mpd_entity_get_type(entity) == MPD_ENTITY_TYPE_SONG &&
3535
types & GCMP_TYPE_FILE) {
3636
const struct mpd_song *song =
3737
mpd_entity_get_song(entity);
38-
name = Utf8ToLocale(mpd_song_get_uri(song)).c_str();
38+
name = Utf8ToLocale{mpd_song_get_uri(song)};
3939
} else if (mpd_entity_get_type(entity) == MPD_ENTITY_TYPE_PLAYLIST &&
4040
types & GCMP_TYPE_PLAYLIST) {
4141
const struct mpd_playlist *playlist =
4242
mpd_entity_get_playlist(entity);
43-
name = Utf8ToLocale(mpd_playlist_get_path(playlist)).c_str();
43+
name = Utf8ToLocale{mpd_playlist_get_path(playlist)};
4444
} else {
4545
continue;
4646
}

0 commit comments

Comments
 (0)