Adapt to net_url changes

This commit is contained in:
Tuncer Ayaz 2012-08-05 14:43:15 +02:00
parent cb85521097
commit 1651d7036b

View file

@ -13,9 +13,8 @@ Create a URL object from a string. Does various helpful browsery things like
*/ */
fn make_url(str_url: ~str, current_url: option<url>) -> url { fn make_url(str_url: ~str, current_url: option<url>) -> url {
let str_url = if get_scheme(str_url).is_some() { let mut schm = get_scheme(str_url);
str_url let str_url = if result::is_err(schm) {
} else {
if current_url.is_none() { if current_url.is_none() {
// If all we have is a filename, assume it's a local relative file // If all we have is a filename, assume it's a local relative file
// and build an absolute path with the cwd // and build an absolute path with the cwd
@ -33,6 +32,8 @@ fn make_url(str_url: ~str, current_url: option<url>) -> url {
current_url.scheme + "://" + path::connect(current_url.host, path) current_url.scheme + "://" + path::connect(current_url.host, path)
} }
} }
} else {
str_url
}; };
// FIXME: Need to handle errors // FIXME: Need to handle errors