@@ -32,14 +32,13 @@ pub(crate) const USERINFO: &AsciiSet = &PATH
32
32
. add ( b'|' ) ;
33
33
34
34
#[ derive( Clone ) ]
35
- pub struct Hostname {
35
+ pub ( super ) struct Hostname {
36
36
serialization : String ,
37
37
38
38
// 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 ,
43
42
}
44
43
45
44
impl Hostname {
@@ -388,7 +387,6 @@ impl Parser {
388
387
}
389
388
// Anarchist URL (no authority)
390
389
let path_start = self . serialization . len ( ) ;
391
- let username_end = path_start;
392
390
let host_start = path_start;
393
391
let host_end = path_start;
394
392
self . serialization . push_str ( input. chars . as_str ( ) ) ;
@@ -401,7 +399,6 @@ impl Parser {
401
399
Ok ( Hostname {
402
400
serialization : self . serialization ,
403
401
scheme_end,
404
- username_end,
405
402
host_start,
406
403
host_end,
407
404
} )
@@ -415,15 +412,14 @@ impl Parser {
415
412
) -> ParseResult < Hostname > {
416
413
self . serialization . push_str ( "//" ) ;
417
414
// authority state
418
- let ( username_end , remaining) = self . parse_userinfo ( input, scheme_type) ?;
415
+ let ( _username_end , remaining) = self . parse_userinfo ( input, scheme_type) ?;
419
416
// host state
420
417
let host_start = self . serialization . len ( ) ;
421
418
let ( host_end, remaining) = self . parse_host ( remaining, scheme_type) ?;
422
419
self . serialization . push_str ( remaining. chars . as_str ( ) ) ;
423
420
Ok ( Hostname {
424
421
serialization : self . serialization ,
425
422
scheme_end,
426
- username_end,
427
423
host_start,
428
424
host_end,
429
425
} )
0 commit comments