2 unstable releases
0.2.0 | Feb 26, 2024 |
---|---|
0.1.0 | Feb 22, 2024 |
#21 in #log-error
5KB
78 lines
unwrap_or_log
This crate adds a function to all [std::results::Result<T,E>
] where E implements std::error::Error
by implementing the trait LogError
for them
The trait LogError
exposes a function LogError::log_error
that takes a result, logs it if it's an error and returns it unmodified:
lib.rs
:
unwrap_or_log
This crate adds a function to all [std::results::Result<T,E>
] where E implements std::error::Error
by implementing the trait LogError
for them
The trait LogError
exposes a function LogError::log_error
that takes a result, logs it if it's an error and returns it unmodified:
Dependencies
~87KB