fix/allow clippy errors
This commit is contained in:
parent
55acd88f0a
commit
8c52d3668e
9 changed files with 51 additions and 30 deletions
|
@ -1,4 +1,5 @@
|
|||
#[cfg(test)]
|
||||
#[allow(clippy::unwrap_used, reason = "these are tests. they may unwrap.")]
|
||||
mod test;
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -45,6 +45,10 @@ pub fn parse_syntax(input: &str) -> Result<Vec<PipelineElement>, Vec<logos::Span
|
|||
match tok {
|
||||
Token::Pipe => {
|
||||
if !partial_command.is_empty() {
|
||||
#[allow(
|
||||
clippy::unwrap_used,
|
||||
reason = "this branch can only run if partial_command isn't empty"
|
||||
)]
|
||||
let span = partial_command.first().unwrap().span.start
|
||||
..partial_command.last().unwrap().span.end;
|
||||
r.push(PipelineElement {
|
||||
|
@ -84,6 +88,10 @@ pub fn parse_syntax(input: &str) -> Result<Vec<PipelineElement>, Vec<logos::Span
|
|||
}
|
||||
|
||||
if !partial_command.is_empty() {
|
||||
#[allow(
|
||||
clippy::unwrap_used,
|
||||
reason = "this branch can only run if partial_command isn't empty"
|
||||
)]
|
||||
let span =
|
||||
partial_command.first().unwrap().span.start..partial_command.last().unwrap().span.end;
|
||||
r.push(PipelineElement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue