+
Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

fix: catalog source fallback #532

Merged
merged 1 commit into from
Feb 8, 2021
Merged

Conversation

casperstorm
Copy link
Member

@casperstorm casperstorm commented Feb 8, 2021

This will resolve the us being able to keep adding sources to the catalog without breaking as just happened.

Checklist

  • Tested on Windows
  • Tested on MacOS
  • Tested on Linux
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users

@casperstorm casperstorm requested a review from tarkah February 8, 2021 08:17
@@ -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"),
Copy link
Member Author

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.

Copy link
Member

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"),
Copy link
Member Author

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.

@casperstorm
Copy link
Member Author

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"),
Copy link
Member

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.

@casperstorm casperstorm merged commit 8558584 into development Feb 8, 2021
@casperstorm casperstorm deleted the fix/catalog-source-fallback branch February 8, 2021 19:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载