rs_std_ext/lib.rs
1//! # `std-ext`
2//! This crate provides some additions to the standard library api.
3//!
4//! ## How to use
5//!
6//! In general, the extensions provided by this crate are based on rust's trait system,
7//! so you only need to import the provided traits to use the extension methods.
8//!
9//! Take `std::option::Option` as an example:
10//!
11//! ```rust
12//! // import the trait
13//! use rs_std_ext::option::OptionExt;
14//!
15//! let op: Option<usize> = Some(42);
16//! assert_eq! (
17//! // this method is defined by the `OptionExt` trait
18//! // Note: The method is deprecated. Use std's method instead.
19//! op.is_none_or(|x| *x > 0),
20//! true
21//! );
22//! ```
23//!
24//! The layout of the extension trait basically matches the layout of rust std and rust core,
25//! with `Ext` as a suffix, e.g. the trait for `std::option::Option` is `rs_std_ext::option::OptionExt`.
26//!
27
28
29pub mod option;
30pub mod result;
31pub mod time;
32pub mod tuple;
33pub mod vec;
34pub mod unwrap;
35
36mod compile_warning;