diff --git a/src/process.rs b/src/process.rs index e251f0aa..754cdeda 100644 --- a/src/process.rs +++ b/src/process.rs @@ -146,7 +146,7 @@ impl PtyProcess { self.kill_timeout = timeout_ms.and_then(|millis| Some(time::Duration::from_millis(millis))); } - /// Get status of child process, nonblocking. + /// Get status of child process, non-blocking. /// /// This method runs waitpid on the process. /// This means: If you ran `exit()` before or `status()` this method will @@ -187,7 +187,7 @@ impl PtyProcess { self.kill(signal::SIGTERM) } - /// Nonblocking variant of `kill()` (doesn't wait for process to be killed) + /// Non-blocking variant of `kill()` (doesn't wait for process to be killed) pub fn signal(&mut self, sig: signal::Signal) -> Result<()> { signal::kill(self.child_pid, sig) .chain_err(|| "failed to send signal to process")?; @@ -198,7 +198,7 @@ impl PtyProcess { /// /// repeatedly sends SIGTERM to the process until it died, /// the pty session is closed upon dropping PtyMaster, - /// so we don't need to explicitely do that here. + /// so we don't need to explicitly do that here. /// /// if `kill_timeout` is set and a repeated sending of signal does not result in the process /// being killed, then `kill -9` is sent after the `kill_timeout` duration has elapsed. diff --git a/src/reader.rs b/src/reader.rs index f479991b..f872302b 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -113,7 +113,7 @@ impl NBReader { /// - f: file like object /// - timeout: /// + `None`: read_until is blocking forever. This is probably not what you want - /// + `Some(millis)`: after millis millisecons a timeout error is raised + /// + `Some(millis)`: after millis milliseconds a timeout error is raised pub fn new(f: R, timeout: Option) -> NBReader { let (tx, rx) = channel(); @@ -257,7 +257,7 @@ impl NBReader { } /// Try to read one char from internal buffer. Returns None if - /// no char is ready, Some(char) otherwise. This is nonblocking + /// no char is ready, Some(char) otherwise. This is non-blocking pub fn try_read(&mut self) -> Option { // discard eventual errors, EOF will be handled in read_until correctly let _ = self.read_into_buffer(); diff --git a/src/session.rs b/src/session.rs index 99f0c96e..379bf8f1 100644 --- a/src/session.rs +++ b/src/session.rs @@ -93,7 +93,7 @@ impl StreamSession { } /// Return `Some(c)` if a char is ready in the stdout stream of the process, return `None` - /// otherwise. This is nonblocking. + /// otherwise. This is non-blocking. pub fn try_read(&mut self) -> Option { self.reader.try_read() } @@ -206,14 +206,14 @@ impl DerefMut for PtySession { /// ``` impl PtySession { fn new(process: PtyProcess, timeout_ms: Option, commandname: String) -> Result { - + let f = process.get_file_handle(); let reader = f.try_clone().chain_err(|| "couldn't open write stream")?; let stream = StreamSession::new(reader, f, timeout_ms); Ok(Self { process, stream, - commandname: commandname, + commandname, }) } } @@ -236,9 +236,9 @@ fn tokenize_command(program: &str) -> Vec { /// /// - `program`: This is split at spaces and turned into a `process::Command` /// if you wish more control over this, use `spawn_command` -/// - `timeout`: If Some: all `exp_*` commands time out after x millisecons, if None: never times +/// - `timeout`: If Some: all `exp_*` commands time out after x milliseconds, if None: never times /// out. -/// It's higly recommended to put a timeout there, as otherwise in case of +/// It's highly recommended to put a timeout there, as otherwise in case of /// a problem the program just hangs instead of exiting with an /// error message indicating where it stopped. /// For automation 30'000 (30s, the default in pexpect) is a good value. @@ -540,7 +540,7 @@ mod tests { p.execute("cat <(echo ready) -", "ready")?; Ok(()) }().unwrap_or_else(|e| panic!("test_kill_timeout failed: {}", e)); - // p is dropped here and kill is sent immediatly to bash + // p is dropped here and kill is sent immediately to bash // Since that is not enough to make bash exit, a kill -9 is sent within 1s (timeout) }