Skip to content

Commit 3a5fa86

Browse files
committed
Remove unused member "commandname"
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
1 parent a599e92 commit 3a5fa86

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/session.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ impl<W: Write> StreamSession<W> {
155155
pub struct PtySession {
156156
pub process: PtyProcess,
157157
pub stream: StreamSession<File>,
158-
pub commandname: String, // only for debugging purposes now
159158
}
160159

161160
// make StreamSession's methods available directly
@@ -192,19 +191,11 @@ impl DerefMut for PtySession {
192191
/// # }
193192
/// ```
194193
impl PtySession {
195-
fn new(
196-
process: PtyProcess,
197-
timeout_ms: Option<u64>,
198-
commandname: String,
199-
) -> Result<Self, Error> {
194+
fn new(process: PtyProcess, timeout_ms: Option<u64>) -> Result<Self, Error> {
200195
let f = process.get_file_handle();
201196
let reader = f.try_clone()?;
202197
let stream = StreamSession::new(reader, f, timeout_ms);
203-
Ok(Self {
204-
process,
205-
stream,
206-
commandname,
207-
})
198+
Ok(Self { process, stream })
208199
}
209200
}
210201

@@ -241,11 +232,10 @@ pub fn spawn(program: &str, timeout_ms: Option<u64>) -> Result<PtySession, Error
241232

242233
/// See `spawn`
243234
pub fn spawn_command(command: Command, timeout_ms: Option<u64>) -> Result<PtySession, Error> {
244-
let commandname = format!("{:?}", &command);
245235
let mut process = PtyProcess::new(command)?;
246236
process.set_kill_timeout(timeout_ms);
247237

248-
PtySession::new(process, timeout_ms, commandname)
238+
PtySession::new(process, timeout_ms)
249239
}
250240

251241
/// A repl session: e.g. bash or the python shell:

0 commit comments

Comments
 (0)