Skip to content

Commit

Permalink
Prefer String::new() to "".to_string()
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys committed May 20, 2024
1 parent 00e0735 commit 6186d77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ impl SBProcess {
/// Reads data from the current process's stdout stream until the end of the stream.
pub fn get_stdout_all(&self) -> Option<String> {
let dst_len = 0x1000;
let mut output = "".to_string();
let mut output = String::new();
let mut dst: Vec<u8> = Vec::with_capacity(dst_len);
loop {
let out_len =
Expand Down Expand Up @@ -339,7 +339,7 @@ impl SBProcess {
/// Reads data from the current process's stderr stream until the end of the stream.
pub fn get_stderr_all(&self) -> Option<String> {
let dst_len = 0x1000;
let mut output = "".to_string();
let mut output = String::new();
let mut dst: Vec<u8> = Vec::with_capacity(dst_len);
loop {
let out_len =
Expand Down

0 comments on commit 6186d77

Please sign in to comment.