aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd/stream.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-10-10 14:09:14 -0400
committerJesse Luehrs <doy@tozt.net>2019-10-10 14:09:14 -0400
commit54e190e78cd81a474622ba3cddc6fe50f7f9112e (patch)
tree50bb575453b0d628d329d278708e3ebada7e8799 /src/cmd/stream.rs
parent63ac8de26b9b91e538a915cc92aef58a1ecfef94 (diff)
downloadteleterm-54e190e78cd81a474622ba3cddc6fe50f7f9112e.tar.gz
teleterm-54e190e78cd81a474622ba3cddc6fe50f7f9112e.zip
make all of my futures/streams not do any work until polled
Diffstat (limited to 'src/cmd/stream.rs')
-rw-r--r--src/cmd/stream.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/cmd/stream.rs b/src/cmd/stream.rs
index 50d2563..107715f 100644
--- a/src/cmd/stream.rs
+++ b/src/cmd/stream.rs
@@ -8,9 +8,6 @@ pub enum Error {
#[snafu(display("{}", source))]
Common { source: crate::error::Error },
- #[snafu(display("failed to run process: {}", source))]
- Spawn { source: crate::process::Error },
-
#[snafu(display("failed to write to stdout: {}", source))]
WriteTerminal { source: tokio::io::Error },
@@ -94,7 +91,7 @@ fn run_impl(
args: &[String],
) -> Result<()> {
tokio::run(
- StreamSession::new(command, args, address, buffer_size, username)?
+ StreamSession::new(command, args, address, buffer_size, username)
.map_err(|e| {
eprintln!("{}", e);
}),
@@ -122,7 +119,7 @@ impl StreamSession {
address: std::net::SocketAddr,
buffer_size: usize,
username: &str,
- ) -> Result<Self> {
+ ) -> Self {
let client =
crate::client::Client::stream(address, username, buffer_size);
@@ -131,10 +128,9 @@ impl StreamSession {
// let input = tokio::io::stdin();
let input = crate::async_stdin::Stdin::new();
- let process =
- crate::process::Process::new(cmd, args, input).context(Spawn)?;
+ let process = crate::process::Process::new(cmd, args, input);
- Ok(Self {
+ Self {
client,
process,
stdout: tokio::io::stdout(),
@@ -144,7 +140,7 @@ impl StreamSession {
needs_flush: false,
done: false,
raw_screen: None,
- })
+ }
}
fn record_bytes(&mut self, buf: &[u8]) {