Skip to content

Commit

Permalink
fix build on stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal authored and FlorentinDUBOIS committed Jul 13, 2022
1 parent c8504d4 commit cbca349
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/src/router/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,17 @@ impl Router {

match ::idna::domain_to_ascii(hostname) {
Ok(hostname) => {
//FIXME: necessary ti build on stable rust (1.35), can be removed once 1.36 is there
let mut empty = true;
if let Some((_, ref mut paths)) = self.tree.domain_lookup_mut(hostname.as_bytes(), false) {
empty = false;
if paths.iter().find(|(p, _)| *p == path).is_none() {
paths.push((path, app_id));
return true;
}
} else {
}

if empty {
self.tree.domain_insert(hostname.into_bytes(), vec![(path, app_id)]);
return true;
}
Expand Down

0 comments on commit cbca349

Please sign in to comment.