Skip to content

Commit

Permalink
Cosmetic changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hniksic committed Sep 15, 2020
1 parent 1a67897 commit 1120f1f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ mod exec {
/// When this is invoked, the subprocess will not inherit the
/// environment of this process.
pub fn env_clear(mut self) -> Exec {
self.config.env = Some(Vec::new());
self.config.env = Some(vec![]);
self
}

Expand Down Expand Up @@ -1033,7 +1033,7 @@ mod pipeline {

impl fmt::Debug for Pipeline {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut args = Vec::new();
let mut args = vec![];
for cmd in &self.cmds {
args.push(cmd.to_cmdline_lossy());
}
Expand Down
12 changes: 6 additions & 6 deletions src/communicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ mod raw {
deadline: Option<Instant>,
size_limit: Option<usize>,
) -> (Option<io::Error>, (Option<Vec<u8>>, Option<Vec<u8>>)) {
let mut outvec = Vec::<u8>::new();
let mut errvec = Vec::<u8>::new();
let mut outvec = vec![];
let mut errvec = vec![];

let err = self
.read_into(deadline, size_limit, &mut outvec, &mut errvec)
Expand Down Expand Up @@ -249,7 +249,7 @@ mod raw {
}
}

fn spawn_curried<T: Send + 'static>(f: impl FnOnce(T) + Send + 'static, arg: T) {
fn spawn_with_arg<T: Send + 'static>(f: impl FnOnce(T) + Send + 'static, arg: T) {
thread::spawn(move || f(arg));
}

Expand Down Expand Up @@ -294,9 +294,9 @@ mod raw {

let (tx, rx) = mpsc::sync_channel(0);

read_stdout.map(|f| spawn_curried(f, tx.clone()));
read_stderr.map(|f| spawn_curried(f, tx.clone()));
write_stdin.map(|f| spawn_curried(f, tx.clone()));
read_stdout.map(|f| spawn_with_arg(f, tx.clone()));
read_stderr.map(|f| spawn_with_arg(f, tx.clone()));
write_stdin.map(|f| spawn_with_arg(f, tx.clone()));

RawCommunicator {
rx,
Expand Down
2 changes: 1 addition & 1 deletion src/popen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ mod os {
}

fn assemble_cmdline(argv: Vec<OsString>) -> io::Result<OsString> {
let mut cmdline = Vec::<u16>::new();
let mut cmdline = vec![];
let mut is_first = true;
for arg in argv {
if !is_first {
Expand Down

0 comments on commit 1120f1f

Please sign in to comment.