Skip to content

Commit 23fb9ec

Browse files
committed
Merge pull request #16 from dotdash/rustup
Fix building with current rust
2 parents 637a57a + fae79ae commit 23fb9ec

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/form_urlencoded.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ pub fn parse_bytes(input: &[u8], encoding_override: Option<EncodingRef>,
5252
} else {
5353
let (name, value) = match piece.position_elem(&b'=') {
5454
Some(position) => (piece.slice_to(position), piece.slice_from(position + 1)),
55-
None => if isindex { (&[], piece) } else { (piece, &[]) }
55+
None => {
56+
let tmp: (&[u8], &[u8]) = if isindex { (&[], piece) } else { (piece, &[]) };
57+
tmp
58+
}
5659
};
5760
let name = replace_plus(name);
5861
let value = replace_plus(value);

src/host.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ impl Host {
7474
// TODO: Remove this check and use IDNA "domain to ASCII"
7575
if !domain.as_slice().is_ascii() {
7676
Err(NonAsciiDomainsNotSupportedYet)
77-
} else if domain.as_slice().find(&[
77+
} else if domain.as_slice().find([
7878
'\0', '\t', '\n', '\r', ' ', '#', '%', '/', ':', '?', '@', '[', '\\', ']'
79-
]).is_some() {
79+
].as_slice()).is_some() {
8080
Err(InvalidDomainCharacter)
8181
} else {
8282
Ok(Domain(domain.into_string().into_ascii_lower()))

src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub enum Context {
100100

101101

102102
pub fn parse_url(input: &str, parser: &UrlParser) -> ParseResult<Url> {
103-
let input = input.trim_chars(&[' ', '\t', '\n', '\r', '\x0C']);
103+
let input = input.trim_chars([' ', '\t', '\n', '\r', '\x0C'].as_slice());
104104
let (scheme, remaining) = match parse_scheme(input, UrlParserContext) {
105105
Some((scheme, remaining)) => (scheme, remaining),
106106
// No-scheme state

0 commit comments

Comments
 (0)