From a383014b890d0cc6c993717be648c207e1f24515 Mon Sep 17 00:00:00 2001 From: Casper Rogild Storm Date: Mon, 8 Feb 2021 09:16:25 +0100 Subject: [PATCH] fix: catalog source fallback --- crates/core/src/catalog.rs | 5 +++++ src/gui/mod.rs | 1 + src/gui/update.rs | 1 + 3 files changed, 7 insertions(+) diff --git a/crates/core/src/catalog.rs b/crates/core/src/catalog.rs index 38a99595..ce8d73c5 100644 --- a/crates/core/src/catalog.rs +++ b/crates/core/src/catalog.rs @@ -67,6 +67,8 @@ pub enum Source { WowI, #[serde(alias = "townlong-yak")] TownlongYak, + #[serde(other)] + Other, } impl std::fmt::Display for Source { @@ -76,6 +78,9 @@ impl std::fmt::Display for Source { Source::Tukui => "Tukui", Source::WowI => "WowInterface", Source::TownlongYak => "TownlongYak", + + // This is a fallback option. + Source::Other => "Unknown", }; write!(f, "{}", s) } diff --git a/src/gui/mod.rs b/src/gui/mod.rs index fa885f90..e037a5bc 100644 --- a/src/gui/mod.rs +++ b/src/gui/mod.rs @@ -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"), }, }; write!(f, "{}", s) diff --git a/src/gui/update.rs b/src/gui/update.rs index f4fa210b..78fbe7f9 100644 --- a/src/gui/update.rs +++ b/src/gui/update.rs @@ -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"), }; RepositoryPackage::from_repo_id(flavor, kind, id)?