Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tiziano88 committed Jun 29, 2020
1 parent f43f3c3 commit dfa524c
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions runner/src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ pub struct Cmd {
}

impl Cmd {
pub fn new<I, S>(executable: &str, args: I) -> Box<dyn Runnable>
pub fn new<I, S>(executable: &str, args: I) -> Box<Self>
where
I: IntoIterator<Item = S>,
S: AsRef<str>,
Expand All @@ -279,11 +279,7 @@ impl Cmd {
})
}

pub fn new_with_env<I, S>(
executable: &str,
args: I,
env: &HashMap<String, String>,
) -> Box<dyn Runnable>
pub fn new_with_env<I, S>(executable: &str, args: I, env: &HashMap<String, String>) -> Box<Self>
where
I: IntoIterator<Item = S>,
S: AsRef<str>,
Expand Down Expand Up @@ -344,8 +340,10 @@ impl Runnable for Cmd {
let stderr = if opt.logs {
std::process::Stdio::inherit()
} else {
// XXX
// The hello_world example client seems to hang when this is set to piped.
std::process::Stdio::null()
// std::process::Stdio::null()
std::process::Stdio::piped()
};
let child = cmd
.stdout(stdout)
Expand Down Expand Up @@ -438,8 +436,8 @@ pub struct CheckLicense {
}

impl CheckLicense {
pub fn new(path: String) -> Box<dyn Runnable> {
Box::new(CheckLicense { path: path })
pub fn new(path: String) -> Box<Self> {
Box::new(CheckLicense { path })
}
}

Expand Down Expand Up @@ -467,8 +465,8 @@ pub struct CheckTodo {
}

impl CheckTodo {
pub fn new(path: String) -> Box<dyn Runnable> {
Box::new(CheckTodo { path: path })
pub fn new(path: String) -> Box<Self> {
Box::new(CheckTodo { path })
}
}

Expand All @@ -480,7 +478,7 @@ impl Runnable for CheckTodo {
.filter(|word| word.contains(&format!("{}{}", "TO", "DO")))
.filter(|word| {
!(word.starts_with(&format!("{}{}(", "TO", "DO"))
&& (word.ends_with("):") || word.ends_with(")")))
&& (word.ends_with("):") || word.ends_with(')')))
})
.collect::<Vec<_>>();
let result = if todo_words.is_empty() {
Expand Down

0 comments on commit dfa524c

Please sign in to comment.