From 0440e04a8a62f26c23c2784be92a367688ebf964 Mon Sep 17 00:00:00 2001 From: Sam Denty Date: Mon, 26 Dec 2022 16:34:12 +0000 Subject: [PATCH] 0.4.7: fix unwrap --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/icons.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 878571e..f89149d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1638,7 +1638,7 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "site_icons" -version = "0.4.6" +version = "0.4.7" dependencies = [ "byteorder", "clap", diff --git a/Cargo.toml b/Cargo.toml index 192b523..500635a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "site_icons" -version = "0.4.6" +version = "0.4.7" authors = ["Sam Denty "] edition = "2018" license = "GPL-3.0" diff --git a/src/icons.rs b/src/icons.rs index fc3804c..1aa7d0d 100644 --- a/src/icons.rs +++ b/src/icons.rs @@ -310,9 +310,9 @@ impl Icons { } } - let (href, _, _) = logos.into_iter().next().unwrap(); - - self.add_icon(href, IconKind::SiteLogo, None); + if let Some((href, _, _)) = logos.into_iter().next() { + self.add_icon(href, IconKind::SiteLogo, None); + } } for elem_ref in document.select(selector!("link[rel='manifest']")) {