Skip to content

Commit e787ba0

Browse files
committed
cleanup unused url_parser internals
`Hostname` was previously public, but technically wasn't accessible since it was in a private module.
1 parent dde13d5 commit e787ba0

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/url_parser/parser.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,13 @@ pub(crate) const USERINFO: &AsciiSet = &PATH
3232
.add(b'|');
3333

3434
#[derive(Clone)]
35-
pub struct Hostname {
35+
pub(super) struct Hostname {
3636
serialization: String,
3737

3838
// Components
39-
pub scheme_end: usize, // Before ':'
40-
pub username_end: usize, // Before ':' (if a password is given) or '@' (if not)
41-
pub host_start: usize,
42-
pub host_end: usize,
39+
pub(super) scheme_end: usize, // Before ':'
40+
pub(super) host_start: usize,
41+
pub(super) host_end: usize,
4342
}
4443

4544
impl Hostname {
@@ -388,7 +387,6 @@ impl Parser {
388387
}
389388
// Anarchist URL (no authority)
390389
let path_start = self.serialization.len();
391-
let username_end = path_start;
392390
let host_start = path_start;
393391
let host_end = path_start;
394392
self.serialization.push_str(input.chars.as_str());
@@ -401,7 +399,6 @@ impl Parser {
401399
Ok(Hostname {
402400
serialization: self.serialization,
403401
scheme_end,
404-
username_end,
405402
host_start,
406403
host_end,
407404
})
@@ -415,15 +412,14 @@ impl Parser {
415412
) -> ParseResult<Hostname> {
416413
self.serialization.push_str("//");
417414
// authority state
418-
let (username_end, remaining) = self.parse_userinfo(input, scheme_type)?;
415+
let (_username_end, remaining) = self.parse_userinfo(input, scheme_type)?;
419416
// host state
420417
let host_start = self.serialization.len();
421418
let (host_end, remaining) = self.parse_host(remaining, scheme_type)?;
422419
self.serialization.push_str(remaining.chars.as_str());
423420
Ok(Hostname {
424421
serialization: self.serialization,
425422
scheme_end,
426-
username_end,
427423
host_start,
428424
host_end,
429425
})

0 commit comments

Comments
 (0)