Skip to content

Commit

Permalink
taking slices from input
Browse files Browse the repository at this point in the history
  • Loading branch information
farooqkz committed Feb 22, 2024
1 parent d492bf0 commit 28cbdf7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/parser/parse_from_text/link_element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,17 @@ fn take_while_pct_encoded(input: &str) -> IResult<&str, &str> {
}

pub fn link(input: &str) -> IResult<&str, Element> {
let input_ = <&str>::clone(input);
let input_ = <&str>::clone(&input);
let (input_, scheme) = scheme(input)?;
let (input_, (userinfo, host, port, path, is_ipv6_or_future)) = ihier_part(input)?;
let (input_, Some(query)) = opt(preceded(char('?'), iquery))(input)?;
let (input_, Some(fragment)) = opt(preceded(char('#'), take_while_ifragment))(input)?;
let mut s = format!("{scheme}://{userinfo}@{host}:{port}{path}?{query}#{fragment}");
Ok((
input[0..s.len()],
&input[0..s.len()],
Element::Link {
destination: LinkDestination {
target: ,
target: &input[(scheme.len() + 3)..(userinfo.len() + 2 + host.len() + port.len())],
hostname: Some(host),
punycode: None,
scheme: scheme,

Check warning on line 302 in src/parser/parse_from_text/link_element.rs

View workflow job for this annotation

GitHub Actions / clippy

redundant field names in struct initialization

warning: redundant field names in struct initialization --> src/parser/parse_from_text/link_element.rs:302:17 | 302 | scheme: scheme, | ^^^^^^^^^^^^^^ help: replace it with: `scheme` | = note: `#[warn(clippy::redundant_field_names)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
Expand Down

0 comments on commit 28cbdf7

Please sign in to comment.