Skip to content

Commit

Permalink
Merge pull request #18 from ernestas-poskus/features/add_full_method_…
Browse files Browse the repository at this point in the history
…to_domain

Add full method to Domain
  • Loading branch information
rushmorem authored May 30, 2019
2 parents 13fa93e + 028d934 commit de3f91c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ impl Host {
if let Ok(domain) = Domain::parse(host, list, true) {
return Ok(Host::Domain(domain));
}
if host.starts_with("[")
if host.starts_with("[")
&& !host.starts_with("[[")
&& host.ends_with("]")
&& !host.ends_with("]]")
Expand Down Expand Up @@ -581,6 +581,11 @@ impl Domain {
true
}

/// Get the full domain
pub fn full(&self) -> &str {
&self.full
}

fn find_possible_matches<'a>(domain: &str, list: &'a List) -> Result<Vec<&'a Suffix>> {
let tld = match domain.rsplit('.').next() {
Some(tld) => {
Expand Down

0 comments on commit de3f91c

Please sign in to comment.