fixed errors
This commit is contained in:
parent
11598f7f50
commit
e1ac6fa79f
2 changed files with 2 additions and 6 deletions
|
@ -1,5 +1,3 @@
|
||||||
use crate::utils::log_failure;
|
|
||||||
|
|
||||||
fn ends_with_newline(source: String) -> Result<(), String> {
|
fn ends_with_newline(source: String) -> Result<(), String> {
|
||||||
if !source.ends_with('\n') {
|
if !source.ends_with('\n') {
|
||||||
Err("source does not end with newline".into())
|
Err("source does not end with newline".into())
|
||||||
|
@ -14,10 +12,7 @@ pub struct Rule {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Rule {
|
impl Rule {
|
||||||
pub fn new<'a>(
|
pub fn new(name: impl ToString, test: impl 'static + Fn(String) -> Result<(), String>) -> Self {
|
||||||
name: impl ToString,
|
|
||||||
test: impl 'static + Fn(String) -> Result<(), String>,
|
|
||||||
) -> Self {
|
|
||||||
let name = name.to_string();
|
let name = name.to_string();
|
||||||
let test = Box::new(test);
|
let test = Box::new(test);
|
||||||
Self { name, test }
|
Self { name, test }
|
||||||
|
|
|
@ -161,6 +161,7 @@ impl CmdTask {
|
||||||
Self { command }
|
Self { command }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::result_unit_err)]
|
||||||
pub fn run(self) -> Result<(), ()> {
|
pub fn run(self) -> Result<(), ()> {
|
||||||
Command::new("sh")
|
Command::new("sh")
|
||||||
.arg("-c")
|
.arg("-c")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue