initiative-sh / initiative.sh

A web-based command line for game masters
https://initiative.sh/
GNU General Public License v3.0
44 stars 4 forks source link

Create new AutocompleteSuggestion struct #329

Closed MikkelPaulson closed 11 months ago

MikkelPaulson commented 11 months ago

Rather than returning the confusing tuple (Cow<'static, str>, Cow<'static, str>) from Autocomplete::autocomplete(), create a new AutocompleteSuggestion struct to better abstract the implementation. The result is occasionally more verbose but hopefully much clearer to read. It has the side benefit of removing a ton of silly .into()s.

Resolves #326.