Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite test_redirect_from_x_to_y_provides_y_cookies_from_y. #14345

Merged
merged 3 commits into from Nov 23, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Improve parse_hostsfile.

  • Loading branch information
Ms2ger committed Nov 23, 2016
commit 9f659e157ad8f069e1685e55b3fd08a890d6e9a3
@@ -37,10 +37,10 @@ fn create_host_table() -> Option<HashMap<String, IpAddr>> {
pub fn parse_hostsfile(hostsfile_content: &str) -> HashMap<String, IpAddr> {
let mut host_table = HashMap::new();
for line in hostsfile_content.split('\n') {
let ip_host: Vec<&str> = line.trim().split(|c: char| c == ' ' || c == '\t').collect();
if ip_host.len() > 1 {
if let Ok(address) = ip_host[0].parse::<IpAddr>() {
for token in ip_host.iter().skip(1) {
let mut ip_host = line.trim().split(|c: char| c == ' ' || c == '\t');
if let Some(ip) = ip_host.next() {
if let Ok(address) = ip.parse::<IpAddr>() {
for token in ip_host {
if token.as_bytes()[0] == b'#' {
break;
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.