Skip to content

Commit

Permalink
change homepage type from string to str
Browse files Browse the repository at this point in the history
  • Loading branch information
LegitCamper committed Oct 11, 2024
1 parent 872d182 commit 6000bff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/widgets/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Engine: BrowserEngine> {
Expand Down Expand Up @@ -160,7 +160,7 @@ impl<Engine: BrowserEngine> IcyBrowser<Engine> {
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!(),
}
Expand Down

0 comments on commit 6000bff

Please sign in to comment.