reduce number of stacks required by inlining ihier part #92
Annotations
9 errors and 17 warnings
slicing may panic:
src/parser/link_url.rs#L460
error: slicing may panic
--> src/parser/link_url.rs:460:17
|
460 | let link = &input_[0..len];
| ^^^^^^^^^^^^^^
|
= help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
indexing into a string may panic if the index is within a UTF-8 character:
src/parser/link_url.rs#L460
error: indexing into a string may panic if the index is within a UTF-8 character
--> src/parser/link_url.rs:460:17
|
460 | let link = &input_[0..len];
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#string_slice
|
integer arithmetic detected:
src/parser/link_url.rs#L459
error: integer arithmetic detected
--> src/parser/link_url.rs:459:15
|
459 | let len = scheme.len() + ihier_len + query.len() + fragment.len();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
|
integer arithmetic detected:
src/parser/link_url.rs#L458
error: integer arithmetic detected
--> src/parser/link_url.rs:458:21
|
458 | let ihier_len = 2 + authority.len() + host.len() + path.len();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
|
slicing may panic:
src/parser/link_url.rs#L324
error: slicing may panic
--> src/parser/link_url.rs:324:18
|
324 | Ok((input, (&i[0..len], host, is_ipv6_or_future)))
| ^^^^^^^^^
|
= help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
indexing into a string may panic if the index is within a UTF-8 character:
src/parser/link_url.rs#L324
error: indexing into a string may panic if the index is within a UTF-8 character
--> src/parser/link_url.rs:324:18
|
324 | Ok((input, (&i[0..len], host, is_ipv6_or_future)))
| ^^^^^^^^^
|
note: the lint level is defined here
--> src/lib.rs:20:5
|
20 | clippy::string_slice,
| ^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#string_slice
|
integer arithmetic detected:
src/parser/link_url.rs#L323
error: integer arithmetic detected
--> src/parser/link_url.rs:323:15
|
323 | let len = userinfo.len() + host.len() + port.len();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> src/lib.rs:12:5
|
12 | clippy::integer_arithmetic,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
|
indexing may panic:
src/parser/parse_from_text/find_range.rs#L28
error: indexing may panic
--> src/parser/parse_from_text/find_range.rs:28:42
|
28 | 0 => FindRangeResult::Range(&ranges[0]),
| ^^^^^^^^^
|
note: the lint level is defined here
--> src/lib.rs:3:5
|
3 | clippy::indexing_slicing,
| ^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider using `.get(n)` or `.get_mut(n)` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
|
test
Process completed with exit code 101.
|
length comparison to zero:
src/parser/link_url.rs#L465
warning: length comparison to zero
--> src/parser/link_url.rs:465:26
|
465 | hostname: if host.len() == 0 { None } else { Some(host) },
| ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `host.is_empty()`
|
= note: `#[warn(clippy::len_zero)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
|
redundant closure:
src/parser/link_url.rs#L396
warning: redundant closure
--> src/parser/link_url.rs:396:22
|
396 | .map(|ch| is_alphanum_or_hyphen_minus(ch))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_alphanum_or_hyphen_minus`
|
= note: `#[warn(clippy::redundant_closure)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
use of `char::is_digit` with literal radix of 10:
src/parser/link_url.rs#L142
warning: use of `char::is_digit` with literal radix of 10
--> src/parser/link_url.rs:142:5
|
142 | c.is_digit(10)
| ^^^^^^^^^^^^^^ help: try: `c.is_ascii_digit()`
|
= note: `#[warn(clippy::is_digit_ascii_radix)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix
|
explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration):
src/parser/parse_from_text/find_range.rs#L23
warning: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
--> src/parser/parse_from_text/find_range.rs:23:1
|
23 | fn find_range_for_char<'a>(code: u32, ranges: &'a [RangeInclusive<u32>]) -> FindRangeResult<'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(clippy::needless_lifetimes)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
|
associated function `parse_standalone_with_whitelist` is never used:
src/parser/link_url.rs#L74
warning: associated function `parse_standalone_with_whitelist` is never used
--> src/parser/link_url.rs:74:19
|
74 | pub(crate) fn parse_standalone_with_whitelist(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
variant `ThisIsNotPercentEncoding` is never constructed:
src/parser/link_url.rs#L112
warning: variant `ThisIsNotPercentEncoding` is never constructed
--> src/parser/link_url.rs:112:5
|
110 | pub enum LinkParseError<I> {
| -------------- variant in this enum
111 | Nom(I, ErrorKind),
112 | ThisIsNotPercentEncoding,
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `LinkParseError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
function `is_allowed_generic_scheme` is never used:
src/parser/link_url.rs#L53
warning: function `is_allowed_generic_scheme` is never used
--> src/parser/link_url.rs:53:4
|
53 | fn is_allowed_generic_scheme(scheme: &str) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
function `not_link_part_char` is never used:
src/parser/parse_from_text/text_elements.rs#L98
warning: function `not_link_part_char` is never used
--> src/parser/parse_from_text/text_elements.rs:98:4
|
98 | fn not_link_part_char(c: char) -> bool {
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
unused variable: `input_`:
src/parser/link_url.rs#L436
warning: unused variable: `input_`
--> src/parser/link_url.rs:436:9
|
436 | let input_ = <&str>::clone(&input);
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_input_`
|
= note: `#[warn(unused_variables)]` on by default
|
unreachable pattern:
src/parser/link_url.rs#L179
warning: unreachable pattern
--> src/parser/link_url.rs:179:29
|
179 | matches!(c, '_' | '.' | '_' | '~')
| ^^^
|
= note: `#[warn(unreachable_patterns)]` on by default
|
unused import: `super::Element`:
src/parser/link_url.rs#L14
warning: unused import: `super::Element`
--> src/parser/link_url.rs:14:5
|
14 | use super::Element;
| ^^^^^^^^^^^^^^
|
unused import: `super::base_parsers::*`:
src/parser/parse_from_text/text_elements.rs#L5
warning: unused import: `super::base_parsers::*`
--> src/parser/parse_from_text/text_elements.rs:5:5
|
5 | use super::base_parsers::*;
| ^^^^^^^^^^^^^^^^^^^^^^
|
unused import: `LinkDestination`:
src/parser/parse_from_text/text_elements.rs#L2
warning: unused import: `LinkDestination`
--> src/parser/parse_from_text/text_elements.rs:2:31
|
2 | use crate::parser::link_url::{LinkDestination, parse_link};
| ^^^^^^^^^^^^^^^
|
unused imports: `direct_delimited`, `is_white_space_but_not_linebreak`, `is_white_space`:
src/parser/parse_from_text/desktop_subset.rs#L6
warning: unused imports: `direct_delimited`, `is_white_space_but_not_linebreak`, `is_white_space`
--> src/parser/parse_from_text/desktop_subset.rs:6:5
|
6 | direct_delimited, is_white_space, is_white_space_but_not_linebreak, CustomError,
| ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
unused import: `super::base_parsers::*`:
src/parser/parse_from_text/desktop_subset.rs#L4
warning: unused import: `super::base_parsers::*`
--> src/parser/parse_from_text/desktop_subset.rs:4:5
|
4 | use super::base_parsers::*;
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
test
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
test
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|