use std_io_iterators::prelude::*;
fn main() -> Result<(), std::io::Error> {
match PipeInIterator::try_new()
.expect("1669235203 - Unable to lock STDIN")
.map(INTERNAL_FUNCTION)
.pipe_out()
{
Err(e) if e.is_broken_pipe() => {
return Ok(());
}
Err(e) => return e.dump_data().into(),
_ => (),
}
if let Err(mut e) = (["test1", "test2", "test3"].iter()).pipe_out() {
e.by_ref()
.for_each(|_recovered_datum| todo!("Handle recovered data"));
return e.result.into();
}
Ok(())
}
const INTERNAL_FUNCTION: fn(std::rc::Rc<String>) -> String =
|line| format!("Prepend-{}", line);