diff options
Diffstat (limited to 'examples/containerexec.rs')
-rw-r--r-- | examples/containerexec.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/containerexec.rs b/examples/containerexec.rs index 0b3575b..0bfd640 100644 --- a/examples/containerexec.rs +++ b/examples/containerexec.rs @@ -25,10 +25,11 @@ fn main() { .containers() .get(&id) .exec(&options) - .for_each(|line| { - match line.stream_type { - StreamType::StdOut => println!("Stdout: {}", line.data), - StreamType::StdErr => eprintln!("Stderr: {}", line.data), + .for_each(|chunk| { + match chunk.stream_type { + StreamType::StdOut => println!("Stdout: {}", chunk.as_string_lossy()), + StreamType::StdErr => eprintln!("Stderr: {}", chunk.as_string_lossy()), + StreamType::StdIn => unreachable!(), } Ok(()) }) |