diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-06-20 14:21:45 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-06-24 19:00:37 +0200 |
commit | 0ec5511b235b6844eca0094505e32e6d911cd142 (patch) | |
tree | f9eaf899fb72e83b326d46cee0cd1a37edb54b79 /ipc/examples | |
parent | 7b2f7e842c359475f9044c969f16527311c4009b (diff) |
ipc: Lazily execute commands.
Diffstat (limited to 'ipc/examples')
-rw-r--r-- | ipc/examples/assuan-client.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ipc/examples/assuan-client.rs b/ipc/examples/assuan-client.rs index 67286e43..d92e0593 100644 --- a/ipc/examples/assuan-client.rs +++ b/ipc/examples/assuan-client.rs @@ -22,9 +22,10 @@ fn main() { .wait().unwrap(); for command in matches.values_of("commands").unwrap() { eprintln!("> {}", command); - c.send(command).wait().unwrap(); - for response in c.by_ref().wait() { + c.send(command).unwrap(); + c.by_ref().for_each(|response| { eprintln!("< {:?}", response); - } + Ok(()) + }).wait().unwrap(); } } |