Skip to main content

else_log

Function else_log 

Source
pub fn else_log<T, E>(error: E) -> Result<T, Infallible>
where T: Default, Error: From<E>,
Expand description

Logs an error and recovers with a default value in an infallible result.

The input is converted to Error and emitted through display formatting. The returned Ok contains Default::default for the requested value type.