Fix lints and things that make clippy sad (#199)
This commit is contained in:
parent
839f314439
commit
98fe09f26b
2
justfile
2
justfile
@ -104,7 +104,7 @@ sloc:
|
|||||||
echo Checking for FIXME/TODO...
|
echo Checking for FIXME/TODO...
|
||||||
! grep --color -En 'FIXME|TODO' src/*.rs
|
! grep --color -En 'FIXME|TODO' src/*.rs
|
||||||
echo Checking for long lines...
|
echo Checking for long lines...
|
||||||
! grep --color -En '.{100}' src/*.rs
|
! grep --color -En '.{101}' src/*.rs
|
||||||
|
|
||||||
nop:
|
nop:
|
||||||
|
|
||||||
|
@ -953,7 +953,8 @@ integration_test! {
|
|||||||
justfile: "bar:\n\t\techo hello\n\t echo goodbye",
|
justfile: "bar:\n\t\techo hello\n\t echo goodbye",
|
||||||
args: (),
|
args: (),
|
||||||
stdout: "",
|
stdout: "",
|
||||||
stderr: "error: Recipe line has inconsistent leading whitespace. Recipe started with `␉␉` but found line with `␉␠`
|
stderr: "error: Recipe line has inconsistent leading whitespace. \
|
||||||
|
Recipe started with `␉␉` but found line with `␉␠`
|
||||||
|
|
|
|
||||||
3 | echo goodbye
|
3 | echo goodbye
|
||||||
| ^
|
| ^
|
||||||
@ -1236,7 +1237,8 @@ integration_test! {
|
|||||||
justfile: "b: a\na FOO:",
|
justfile: "b: a\na FOO:",
|
||||||
args: ("b"),
|
args: ("b"),
|
||||||
stdout: "",
|
stdout: "",
|
||||||
stderr: "error: Recipe `b` depends on `a` which requires arguments. Dependencies may not require arguments
|
stderr: "error: Recipe `b` depends on `a` which requires arguments. \
|
||||||
|
Dependencies may not require arguments
|
||||||
|
|
|
|
||||||
1 | b: a
|
1 | b: a
|
||||||
| ^
|
| ^
|
||||||
|
11
src/lib.rs
11
src/lib.rs
@ -102,7 +102,7 @@ fn empty<T, C: iter::FromIterator<T>>() -> C {
|
|||||||
iter::empty().collect()
|
iter::empty().collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn contains<T: PartialOrd>(range: &Range<T>, i: T) -> bool {
|
fn contains<T: PartialOrd + Copy>(range: &Range<T>, i: T) -> bool {
|
||||||
i >= range.start && i < range.end
|
i >= range.start && i < range.end
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,8 +207,8 @@ impl<'a> Display for Expression<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return a RunError::Signal if the process was terminated by a signal,
|
/// Return a `RunError::Signal` if the process was terminated by a signal,
|
||||||
/// otherwise return an RunError::UnknownFailure
|
/// otherwise return an `RunError::UnknownFailure`
|
||||||
fn error_from_signal(
|
fn error_from_signal(
|
||||||
recipe: &str,
|
recipe: &str,
|
||||||
line_number: Option<usize>,
|
line_number: Option<usize>,
|
||||||
@ -257,7 +257,7 @@ fn run_backtick<'a>(
|
|||||||
process::Stdio::inherit()
|
process::Stdio::inherit()
|
||||||
});
|
});
|
||||||
|
|
||||||
output(cmd).map_err(|output_error| RunError::Backtick{token: token.clone(), output_error: output_error})
|
output(cmd).map_err(|output_error| RunError::Backtick{token: token.clone(), output_error})
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Recipe<'a> {
|
impl<'a> Recipe<'a> {
|
||||||
@ -1121,7 +1121,8 @@ impl<'a> Display for CompileError<'a> {
|
|||||||
}
|
}
|
||||||
InconsistentLeadingWhitespace{expected, found} => {
|
InconsistentLeadingWhitespace{expected, found} => {
|
||||||
writeln!(f,
|
writeln!(f,
|
||||||
"Recipe line has inconsistent leading whitespace. Recipe started with `{}` but found line with `{}`",
|
"Recipe line has inconsistent leading whitespace. \
|
||||||
|
Recipe started with `{}` but found line with `{}`",
|
||||||
show_whitespace(expected), show_whitespace(found)
|
show_whitespace(expected), show_whitespace(found)
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user