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...
|
||||
! grep --color -En 'FIXME|TODO' src/*.rs
|
||||
echo Checking for long lines...
|
||||
! grep --color -En '.{100}' src/*.rs
|
||||
! grep --color -En '.{101}' src/*.rs
|
||||
|
||||
nop:
|
||||
|
||||
|
@ -953,7 +953,8 @@ integration_test! {
|
||||
justfile: "bar:\n\t\techo hello\n\t echo goodbye",
|
||||
args: (),
|
||||
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
|
||||
| ^
|
||||
@ -1236,7 +1237,8 @@ integration_test! {
|
||||
justfile: "b: a\na FOO:",
|
||||
args: ("b"),
|
||||
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
|
||||
| ^
|
||||
|
11
src/lib.rs
11
src/lib.rs
@ -102,7 +102,7 @@ fn empty<T, C: iter::FromIterator<T>>() -> C {
|
||||
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
|
||||
}
|
||||
|
||||
@ -207,8 +207,8 @@ impl<'a> Display for Expression<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Return a RunError::Signal if the process was terminated by a signal,
|
||||
/// otherwise return an RunError::UnknownFailure
|
||||
/// Return a `RunError::Signal` if the process was terminated by a signal,
|
||||
/// otherwise return an `RunError::UnknownFailure`
|
||||
fn error_from_signal(
|
||||
recipe: &str,
|
||||
line_number: Option<usize>,
|
||||
@ -257,7 +257,7 @@ fn run_backtick<'a>(
|
||||
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> {
|
||||
@ -1121,7 +1121,8 @@ impl<'a> Display for CompileError<'a> {
|
||||
}
|
||||
InconsistentLeadingWhitespace{expected, found} => {
|
||||
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)
|
||||
)?;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user