dnetview: trick to return View error from anon closure
due to the issue of returning a value inside an anonymous closure, we
process errors received from View as follows:
let mut err: Option<DnetViewError> = None;
terminal.draw(|f| match view.render(f) {
Ok(()) => {}
Err(e) => {
err = Some(e);
}
})?;
match err {
Some(e) => return Err(e),
None => {}
}
we create a None option wrapper around DnetViewError. we then write the
error value to the option, and later perform a match on the error and
return.