Remove some unused stuff from url
This commit is contained in:
parent
164b4a36c3
commit
4f5183898c
13
src/url.rs
13
src/url.rs
@ -8,12 +8,10 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::fmt;
|
||||
use std::str::FromStr;
|
||||
use std::num;
|
||||
use std::str;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct Url {
|
||||
pub scheme: String,
|
||||
pub user: Option<UserInfo>,
|
||||
@ -22,14 +20,12 @@ pub struct Url {
|
||||
pub path: Path,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct Path {
|
||||
pub path: String,
|
||||
pub query: Query,
|
||||
pub fragment: Option<String>
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct UserInfo {
|
||||
pub user: String,
|
||||
pub pass: Option<String>
|
||||
@ -163,15 +159,6 @@ fn split_char_first(s: &str, c: char) -> (&str, &str) {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for UserInfo {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self.pass {
|
||||
Some(ref pass) => write!(f, "{}:{}@", self.user, *pass),
|
||||
None => write!(f, "{}@", self.user),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn query_from_str(rawquery: &str) -> DecodeResult<Query> {
|
||||
let mut query: Query = vec!();
|
||||
if !rawquery.is_empty() {
|
||||
|
Loading…
Reference in New Issue
Block a user