From 77b604d2af1a231fa2e9ece56b43177e0a9981ab Mon Sep 17 00:00:00 2001 From: messense Date: Mon, 25 Apr 2016 12:33:15 +0800 Subject: [PATCH] Bump version to 0.4.3 Signed-off-by: messense --- Cargo.toml | 6 +++--- src/lib.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 22c87f3..a6a71e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,12 +8,12 @@ license = "MIT" name = "robotparser" readme = "README.md" repository = "https://github.com/messense/robotparser-rs" -version = "0.4.2" +version = "0.4.3" [dependencies] -hyper = "0.8" +hyper = "0.9" time = "0.1" -url = "0.5" +url = "1.0" [dependencies.clippy] optional = true diff --git a/src/lib.rs b/src/lib.rs index 952898b..00f648e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -192,7 +192,7 @@ impl RobotFileParser { allow_all: Cell::new(false), url: parsed_url.clone(), host: parsed_url.domain().unwrap().to_owned(), - path: parsed_url.path().unwrap().join("/"), + path: parsed_url.path().to_owned(), last_checked: Cell::new(0i64), } } @@ -218,7 +218,7 @@ impl RobotFileParser { let parsed_url = Url::parse(url.as_ref()).unwrap(); self.url = parsed_url.clone(); self.host = parsed_url.domain().unwrap().to_owned(); - self.path = parsed_url.path().unwrap().join("/"); + self.path = parsed_url.path().to_owned(); self.last_checked.set(0i64); } @@ -306,7 +306,7 @@ impl RobotFileParser { let parts: Vec<&str> = ln.splitn(2, ':').collect(); if parts.len() == 2 { let part0 = parts[0].trim().to_lowercase(); - let part1 = String::from_utf8(percent_decode(parts[1].trim().as_bytes())).unwrap_or("".to_owned()); + let part1 = String::from_utf8(percent_decode(parts[1].trim().as_bytes()).collect()).unwrap_or("".to_owned()); match part0 { ref x if x == "user-agent" => { if state == 2 { @@ -376,7 +376,7 @@ impl RobotFileParser { } // search for given user agent matches // the first match counts - let decoded_url = String::from_utf8(percent_decode(url.trim().as_bytes())).unwrap_or("".to_owned()); + let decoded_url = String::from_utf8(percent_decode(url.trim().as_bytes()).collect()).unwrap_or("".to_owned()); let url_str = match decoded_url { ref u if !u.is_empty() => u.to_owned(), _ => "/".to_owned(),