-
Notifications
You must be signed in to change notification settings - Fork 87
Conversation
@@ -1845,6 +1845,7 @@ impl std::fmt::Display for CatalogSource { | |||
catalog::Source::Tukui => "Tukui", | |||
catalog::Source::WowI => "WowInterface", | |||
catalog::Source::TownlongYak => "Townlong-Yak", | |||
catalog::Source::Other => panic!("Unspported catalog source"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine to panic!
in the std::fmt::Display
since we don't want to render this to the GUI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup! The only way it'll expose itself in the GUI and make allow any catalog items for it to display is if you add it to the CatalogSource::all method. Since we left it out, these should be unreachable and it'd be impossible to show those items in the GUI.
@@ -2134,6 +2134,7 @@ async fn perform_fetch_latest_addon( | |||
catalog::Source::Tukui => RepositoryKind::Tukui, | |||
catalog::Source::WowI => RepositoryKind::WowI, | |||
catalog::Source::TownlongYak => RepositoryKind::TownlongYak, | |||
catalog::Source::Other => panic!("Unspported catalog source"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine to panic!
since it shouldn't be possible to end here with a catalog::Source::Other
.
Care to take a look at this @tarkah, and see if this was your idea as well. |
@@ -1845,6 +1845,7 @@ impl std::fmt::Display for CatalogSource { | |||
catalog::Source::Tukui => "Tukui", | |||
catalog::Source::WowI => "WowInterface", | |||
catalog::Source::TownlongYak => "Townlong-Yak", | |||
catalog::Source::Other => panic!("Unspported catalog source"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup! The only way it'll expose itself in the GUI and make allow any catalog items for it to display is if you add it to the CatalogSource::all method. Since we left it out, these should be unreachable and it'd be impossible to show those items in the GUI.
This will resolve the us being able to keep adding sources to the catalog without breaking as just happened.
Checklist
CHANGELOG.md
if knowledge of this change could be valuable to users