1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#[macro_use]
pub mod macros;
pub mod error;

pub use error::Error;

#[cfg(feature = "__v3")]
pub mod v3;

#[cfg(feature = "__v4")]
pub mod v4;
#[cfg(feature = "__v4")]
pub use rmpv::{self, Value};

#[inline(always)]
fn log_result<T, E: std::error::Error>(result: Result<T, E>) -> Result<T, E> {
    #[cfg(feature = "tracing")]
    match &result {
        Err(err) => {
            tracing::error!("{}", err)
        }
        _ => {}
    };
    result
}