I want to reduce nesting level of the following code:
read(file)
.map_err(|error| format!("cannot read file {:?}: {}", file, error))
.and_then(|content| {
String::from_utf8(content).map_err(|error| {
format!(
"cannot convert content of file {:?} to UTF-8: {}",
file, error
)
})
})