Skip to content

Commit

Permalink
Fix warnings on rustc 193390d0e 2014-12-11.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Dec 12, 2014
1 parent 1b626ae commit 1c738d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
15 changes: 1 addition & 14 deletions src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,11 @@ pub enum Host {


/// A 128 bit IPv6 address
#[deriving(Clone, Eq, PartialEq, Copy)]
pub struct Ipv6Address {
pub pieces: [u16, ..8]
}

impl Clone for Ipv6Address {
fn clone(&self) -> Ipv6Address {
Ipv6Address { pieces: self.pieces }
}
}

impl Eq for Ipv6Address {}

impl PartialEq for Ipv6Address {
fn eq(&self, other: &Ipv6Address) -> bool {
self.pieces == other.pieces
}
}


impl Host {
/// Parse a host: either an IPv6 address in [] square brackets, or a domain.
Expand Down
20 changes: 10 additions & 10 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub type ParseResult<T> = Result<T, ParseError>;
macro_rules! simple_enum_error {
($($name: ident => $description: expr,)+) => {
/// Errors that can occur during parsing.
#[deriving(PartialEq, Eq, Clone)]
#[deriving(PartialEq, Eq, Clone, Copy)]
pub enum ParseError {
$(
$name,
Expand Down Expand Up @@ -696,15 +696,15 @@ fn is_url_code_point(c: char) -> bool {
'0'...'9' |
'!' | '$' | '&' | '\'' | '(' | ')' | '*' | '+' | ',' | '-' |
'.' | '/' | ':' | ';' | '=' | '?' | '@' | '_' | '~' |
'\u00A0'...'\uD7FF' | '\uE000'...'\uFDCF' | '\uFDF0'...'\uFFFD' |
'\U00010000'...'\U0001FFFD' | '\U00020000'...'\U0002FFFD' |
'\U00030000'...'\U0003FFFD' | '\U00040000'...'\U0004FFFD' |
'\U00050000'...'\U0005FFFD' | '\U00060000'...'\U0006FFFD' |
'\U00070000'...'\U0007FFFD' | '\U00080000'...'\U0008FFFD' |
'\U00090000'...'\U0009FFFD' | '\U000A0000'...'\U000AFFFD' |
'\U000B0000'...'\U000BFFFD' | '\U000C0000'...'\U000CFFFD' |
'\U000D0000'...'\U000DFFFD' | '\U000E1000'...'\U000EFFFD' |
'\U000F0000'...'\U000FFFFD' | '\U00100000'...'\U0010FFFD' => true,
'\u{A0}'...'\u{D7FF}' | '\u{E000}'...'\u{FDCF}' | '\u{FDF0}'...'\u{FFFD}' |
'\u{10000}'...'\u{1FFFD}' | '\u{20000}'...'\u{2FFFD}' |
'\u{30000}'...'\u{3FFFD}' | '\u{40000}'...'\u{4FFFD}' |
'\u{50000}'...'\u{5FFFD}' | '\u{60000}'...'\u{6FFFD}' |
'\u{70000}'...'\u{7FFFD}' | '\u{80000}'...'\u{8FFFD}' |
'\u{90000}'...'\u{9FFFD}' | '\u{A0000}'...'\u{AFFFD}' |
'\u{B0000}'...'\u{BFFFD}' | '\u{C0000}'...'\u{CFFFD}' |
'\u{D0000}'...'\u{DFFFD}' | '\u{E1000}'...'\u{EFFFD}' |
'\u{F0000}'...'\u{FFFFD}' | '\u{100000}'...'\u{10FFFD}' => true,
_ => false
}
}
Expand Down

0 comments on commit 1c738d2

Please sign in to comment.