fix: stricter input parsing and more lenient parsing of run exports from other packages #1794
Annotations
2 errors
Run giraffate/clippy-action@v1:
src/recipe/parser/requirements.rs#L374
[clippy] reported by reviewdog 🐶
error: this `if` statement can be collapsed
--> src/recipe/parser/requirements.rs:374:9
|
374 | / if split_string.len() >= 2 {
375 | | if split_string[1].chars().all(|c| c.is_numeric() || c == '.') {
376 | | let name = split_string[0];
377 | | let version = split_string[1];
... |
392 | | }
393 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `-D clippy::collapsible-if` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::collapsible_if)]`
help: collapse nested if block
|
374 ~ if split_string.len() >= 2 && split_string[1].chars().all(|c| c.is_numeric() || c == '.') {
375 + let name = split_string[0];
376 + let version = split_string[1];
377 + let rest = split_string[2..].join(" ");
378 + let rest = if rest.is_empty() {
379 + "".to_string()
380 + } else {
381 + format!(" {}", rest)
382 + };
383 +
384 + return Err(vec![_partialerror!(
385 + *self.span(),
386 + ErrorKind::Other,
387 + label = format!(
388 + "This match spec is ambiguous. Do you mean `{name} =={version}{rest}` or `{name} {version}.*{rest}`?"
389 + )
390 + )]);
391 + }
|
Raw Output:
src/recipe/parser/requirements.rs:374:9:e:error: this `if` statement can be collapsed
--> src/recipe/parser/requirements.rs:374:9
|
374 | / if split_string.len() >= 2 {
375 | | if split_string[1].chars().all(|c| c.is_numeric() || c == '.') {
376 | | let name = split_string[0];
377 | | let version = split_string[1];
... |
392 | | }
393 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `-D clippy::collapsible-if` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::collapsible_if)]`
help: collapse nested if block
|
374 ~ if split_string.len() >= 2 && split_string[1].chars().all(|c| c.is_numeric() || c == '.') {
375 + let name = split_string[0];
376 + let version = split_string[1];
377 + let rest = split_string[2..].join(" ");
378 + let rest = if rest.is_empty() {
379 + "".to_string()
380 + } else {
381 + format!(" {}", rest)
382 + };
383 +
384 + return Err(vec![_partialerror!(
385 + *self.span(),
386 + ErrorKind::Other,
387 + label = format!(
388 + "This match spec is ambiguous. Do you mean `{name} =={version}{rest}` or `{name} {version}.*{rest}`?"
389 + )
390 + )]);
391 + }
|
__END__
|
Run giraffate/clippy-action@v1:
src/recipe/parser/requirements.rs#L374
[clippy] reported by reviewdog 🐶
error: this `if` statement can be collapsed
--> src/recipe/parser/requirements.rs:374:9
|
374 | / if split_string.len() >= 2 {
375 | | if split_string[1].chars().all(|c| c.is_numeric() || c == '.') {
376 | | let name = split_string[0];
377 | | let version = split_string[1];
... |
392 | | }
393 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `-D clippy::collapsible-if` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::collapsible_if)]`
help: collapse nested if block
|
374 ~ if split_string.len() >= 2 && split_string[1].chars().all(|c| c.is_numeric() || c == '.') {
375 + let name = split_string[0];
376 + let version = split_string[1];
377 + let rest = split_string[2..].join(" ");
378 + let rest = if rest.is_empty() {
379 + "".to_string()
380 + } else {
381 + format!(" {}", rest)
382 + };
383 +
384 + return Err(vec![_partialerror!(
385 + *self.span(),
386 + ErrorKind::Other,
387 + label = format!(
388 + "This match spec is ambiguous. Do you mean `{name} =={version}{rest}` or `{name} {version}.*{rest}`?"
389 + )
390 + )]);
391 + }
|
Raw Output:
src/recipe/parser/requirements.rs:374:9:e:error: this `if` statement can be collapsed
--> src/recipe/parser/requirements.rs:374:9
|
374 | / if split_string.len() >= 2 {
375 | | if split_string[1].chars().all(|c| c.is_numeric() || c == '.') {
376 | | let name = split_string[0];
377 | | let version = split_string[1];
... |
392 | | }
393 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `-D clippy::collapsible-if` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::collapsible_if)]`
help: collapse nested if block
|
374 ~ if split_string.len() >= 2 && split_string[1].chars().all(|c| c.is_numeric() || c == '.') {
375 + let name = split_string[0];
376 + let version = split_string[1];
377 + let rest = split_string[2..].join(" ");
378 + let rest = if rest.is_empty() {
379 + "".to_string()
380 + } else {
381 + format!(" {}", rest)
382 + };
383 +
384 + return Err(vec![_partialerror!(
385 + *self.span(),
386 + ErrorKind::Other,
387 + label = format!(
388 + "This match spec is ambiguous. Do you mean `{name} =={version}{rest}` or `{name} {version}.*{rest}`?"
389 + )
390 + )]);
391 + }
|
__END__
|
Loading