Skip to content

Commit f86c2bb

Browse files
committed
refactor(session): Move split after use
1 parent 9c9ca50 commit f86c2bb

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/session.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use crate::process::PtyProcess;
55
use crate::reader::{NBReader, Regex};
66
pub use crate::reader::{Options, ReadUntil};
77
use std::fs::File;
8-
use std::io::LineWriter;
98
use std::io::prelude::*;
9+
use std::io::LineWriter;
1010
use std::ops::{Deref, DerefMut};
1111
use std::process::Command;
1212
use tempfile;
@@ -212,12 +212,6 @@ impl PtySession {
212212
}
213213
}
214214

215-
/// Turn e.g. "prog arg1 arg2" into ["prog", "arg1", "arg2"]
216-
/// Also takes care of single and double quotes
217-
fn tokenize_command(program: &str) -> Result<Vec<String>, Error> {
218-
comma::parse_command(program).ok_or(Error::BadProgramArguments)
219-
}
220-
221215
/// Start command in background in a pty session (pty fork) and return a struct
222216
/// with writer and buffered reader (for unblocking reads).
223217
///
@@ -243,6 +237,12 @@ pub fn spawn(program: &str, timeout_ms: Option<u64>) -> Result<PtySession, Error
243237
spawn_command(command, timeout_ms)
244238
}
245239

240+
/// Turn e.g. "prog arg1 arg2" into ["prog", "arg1", "arg2"]
241+
/// Also takes care of single and double quotes
242+
fn tokenize_command(program: &str) -> Result<Vec<String>, Error> {
243+
comma::parse_command(program).ok_or(Error::BadProgramArguments)
244+
}
245+
246246
/// See [`spawn`]
247247
pub fn spawn_command(command: Command, timeout_ms: Option<u64>) -> Result<PtySession, Error> {
248248
spawn_with_options(

0 commit comments

Comments
 (0)