diff options
Diffstat (limited to 'src/components/util/url.rs')
-rw-r--r-- | src/components/util/url.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/components/util/url.rs b/src/components/util/url.rs index 4d08386511d..0f0ff19331d 100644 --- a/src/components/util/url.rs +++ b/src/components/util/url.rs @@ -2,11 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use extra::net::url; -use extra::net::url::Url; +use extra::url; +use extra::url::Url; use std::hashmap::HashMap; use std::os; -use std::result; /** Create a URL object from a string. Does various helpful browsery things like @@ -19,7 +18,7 @@ Create a URL object from a string. Does various helpful browsery things like */ pub fn make_url(str_url: ~str, current_url: Option<Url>) -> Url { let schm = url::get_scheme(str_url); - let str_url = if result::is_err(&schm) { + let str_url = if schm.is_err() { if current_url.is_none() { // Assume we've been given a file path. If it's absolute just return // it, otherwise make it absolute with the cwd. @@ -29,7 +28,7 @@ pub fn make_url(str_url: ~str, current_url: Option<Url>) -> Url { ~"file://" + os::getcwd().push(str_url).to_str() } } else { - let current_url = current_url.get(); + let current_url = current_url.unwrap(); debug!("make_url: current_url: %?", current_url); if str_url.starts_with("//") { current_url.scheme + ":" + str_url @@ -56,7 +55,7 @@ pub fn make_url(str_url: ~str, current_url: Option<Url>) -> Url { }; // FIXME: Need to handle errors - url::from_str(str_url).get() + url::from_str(str_url).unwrap() } mod make_url_tests { |