8 releases (breaking)
0.7.0 | May 2, 2019 |
---|---|
0.6.0 | Mar 16, 2019 |
0.5.0 | Mar 15, 2019 |
0.4.0 | Mar 15, 2019 |
0.1.0 | Feb 2, 2019 |
#2890 in Rust patterns
24KB
423 lines
Description
This library contains my personal Rust prelude and utilities.
Design goals
- Remove the hassle of having to add
use
statements for very common standard library types - Reduce the amount of code that actually has to be written
- Alleviate common Rust pain points
This library is meant to improve your experience writing Rust no matter what you are writing code for. The patterns it tackles are mostly ones that the average Rust programmer encounters on a daily basis.
lib.rs
:
Description
This library contains my personal Rust prelude and utilities.
Design goals
- Remove the hassle of having to add
use
statements for very common standard library types - Reduce the amount of code that actually has to be written
- Alleviate common Rust pain points
This library is meant to improve your experience writing Rust no matter what you are writing code for. The patterns it tackles are mostly ones that the average Rust programmer encounters on a daily basis.
Utilities
I have made some very simple utilities to aid in writing Rust code:
Modules
thread
Adds custom thread type as well as reexportingstd::thread::*
for convenience.
Functions
order
Functions for fully orderingPartialOrd
typesclose
Functions for checking if two floating-point numbers are close enough to be considered equalpromote_then
Temporarily gain access to an immutable reference as mutable
Traits
BoolMap
Mapsbool
s toOption
s in one lineBind
Allows the binding and mutation of a value in a single lineKaiIterator
Generates my custom iterator adapters
Structs
Adapter
Wraps a reference to a string representation of some typeSwap
Wrapper that allows consuming transformations on borrowed data
Types
Macros
variant!
Maps an enum to an option for use withIterator::filter_map
transparent_mod!
Declares transparent external child modulescond_vec!
Conditionally constructVec
s