From 6000bffbbce4cae988c670046750b1e16e91505a Mon Sep 17 00:00:00 2001 From: sawyer bristol Date: Fri, 11 Oct 2024 17:22:29 -0600 Subject: [PATCH] change homepage type from string to str --- src/widgets/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/widgets/mod.rs b/src/widgets/mod.rs index 2248c48..e2fe6f3 100644 --- a/src/widgets/mod.rs +++ b/src/widgets/mod.rs @@ -111,10 +111,10 @@ impl Default for TabSelectionType { } /// Allows the user to write a custom homepage -pub enum HomepageType { - Url(String), +pub enum HomepageType<'a> { + Url(&'a str), /// This is rendered with html - Custom(String), + Custom(&'a str), } pub struct IcyBrowser { @@ -160,7 +160,7 @@ impl IcyBrowser { pub fn with_homepage(mut self, homepage: HomepageType) -> Self { match homepage { HomepageType::Url(url) => { - self.home = Url::parse(&url).expect("Failed to parse homepage as a url!"); + self.home = Url::parse(url).expect("Failed to parse homepage as a url!"); } HomepageType::Custom(_) => todo!(), }