fixed errors

This commit is contained in:
JOLIMAITRE Matthieu 2022-09-25 15:59:22 +02:00
parent 11598f7f50
commit e1ac6fa79f
2 changed files with 2 additions and 6 deletions

View file

@ -1,5 +1,3 @@
use crate::utils::log_failure;
fn ends_with_newline(source: String) -> Result<(), String> {
if !source.ends_with('\n') {
Err("source does not end with newline".into())
@ -14,10 +12,7 @@ pub struct Rule {
}
impl Rule {
pub fn new<'a>(
name: impl ToString,
test: impl 'static + Fn(String) -> Result<(), String>,
) -> Self {
pub fn new(name: impl ToString, test: impl 'static + Fn(String) -> Result<(), String>) -> Self {
let name = name.to_string();
let test = Box::new(test);
Self { name, test }

View file

@ -161,6 +161,7 @@ impl CmdTask {
Self { command }
}
#[allow(clippy::result_unit_err)]
pub fn run(self) -> Result<(), ()> {
Command::new("sh")
.arg("-c")