feat(lib): switch to non-blocking (asynchronous) IO
BREAKING CHANGE: This breaks a lot of the Client and Server APIs. Check the documentation for how Handlers can be used for asynchronous events.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use header::{Header, HeaderFormat};
|
||||
use header::{Header};
|
||||
use std::fmt;
|
||||
use header::parsing::from_one_raw_str;
|
||||
|
||||
@@ -52,9 +52,7 @@ impl Header for Host {
|
||||
// https://github.com/servo/rust-url/issues/42
|
||||
let idx = {
|
||||
let slice = &s[..];
|
||||
let mut chars = slice.chars();
|
||||
chars.next();
|
||||
if chars.next().unwrap() == '[' {
|
||||
if slice.starts_with('[') {
|
||||
match slice.rfind(']') {
|
||||
Some(idx) => {
|
||||
if slice.len() > idx + 2 {
|
||||
@@ -86,9 +84,7 @@ impl Header for Host {
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl HeaderFormat for Host {
|
||||
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self.port {
|
||||
None | Some(80) | Some(443) => f.write_str(&self.hostname[..]),
|
||||
|
||||
Reference in New Issue
Block a user