Skip to content

Commit

Permalink
Fix lints and things that make clippy sad (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored May 13, 2017
1 parent 839f314 commit 98fe09f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
6 changes: 4 additions & 2 deletions src/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
| ^
Expand Down Expand Up @@ -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
| ^
Expand Down
11 changes: 6 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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>,
Expand Down Expand Up @@ -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> {
Expand Down Expand Up @@ -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)
)?;
}
Expand Down

0 comments on commit 98fe09f

Please sign in to comment.