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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Crate `inspector` extends popular data structures (such as `Option` and `Result`)
//! with additional methods for inspecting their payload. It is inspired by the `Iterator::inspect`.
//! Since no such methods are available by default on `Option` and `Result` types, this crate
//! implements a new traits for these types, which augment the respective types with various
//! inspection capabilities.
//!
//! Implementation and availability of each trait is guarded by the dedicated feature, so that
//! you can choose which one is available. Sometimes you want these only for debug purposes, but
//! prefer to always leave the code in place. Feature `debug-only` helps in this case.
//! If enabled and compiled in `release` mode the combinators become effectively NOP.
//! This feature does nothing in `debug` mode.
//!
//! # Features
//! - `debug-only` - turnes the combinators into NOP in release mode
//! - `option` - enables trait `OptionInspector`
//! - `result` - enables trait `ResultInspector`
//! - `futures` - enables trait `FuturesInspector`

#![cfg_attr(feature = "pedantic", warn(clippy::pedantic))]
#![warn(clippy::use_self)]
#![warn(deprecated_in_future)]
#![warn(future_incompatible)]
#![warn(unreachable_pub)]
#![warn(missing_debug_implementations)]
#![warn(rust_2018_compatibility)]
#![warn(rust_2018_idioms)]
#![warn(unused)]
#![deny(warnings)]

#[cfg(feature = "futures")]
mod future;
#[cfg(feature = "iter")]
mod iter;
#[cfg(feature = "option")]
mod option;
#[cfg(feature = "result")]
mod result;

#[cfg(feature = "futures")]
pub use crate::future::FutureInspector;
#[cfg(feature = "iter")]
pub use crate::iter::IterInspector;
#[cfg(feature = "option")]
pub use crate::option::OptionInspector;
#[cfg(feature = "result")]
pub use crate::result::ResultInspector;