junkdrawer 0.1.0

A crate for all kinds of utilities.
Documentation
#![warn(clippy::all, clippy::pedantic, clippy::nursery, clippy::nursery)]
#![warn(
    clippy::default_numeric_fallback,
    clippy::get_unwrap,
    clippy::if_then_some_else_none
)]
#![deny(clippy::perf, clippy::cargo)]

//! A utility crate for rust.
//!
//! Like your favorite junkdrawer this includes a lot of useful things.
//! The question is just what of this stuff will be useful at what time.
//! Unlike the junkdrawer you can just enable/disable features to make entire groups of things appear/disappear.
//!
//! This crate is split into multiple modules guarded by their own feature flag.
//! The stuff provided by this crate is all over the place but mostly consists of
//!
//! - convenience functions that make code more readable,
//! - stuff that is nice to have, exists in nightly, and does not require unstable features,
//! - additional datastructures that provide speedups and/or safe memory in certain conditions.
//!   However, these faster/memory-efficient implementations require just enough effort to write that it is not worth the hassle.
//!   Well, now I wrote them and you can just use them.
//!
//! ## Modules
//!
//! These modules (and feature flags) mimic the names of the corresponding modules in [`std`]
//! - [`mod@array`]: Some more functions to make working with arrays easier.
//! - [`mod@collections`]: Additional storage functionality and structures.
//! - [`mod@convert`]: Some convenience functions that are nice in iterators and so on.
//! - [`mod@mem`]: Utility functions for (mostly unsafe) memory manipulation.
//! - [`mod@sync`]: A module that contain some utility for working with sync code.
//! - [`mod@vec`]: Additional functions for vectors and an allocation-free vector on the stack (that does not grow dynamically)
//!


macro_rules! modules {
    ($($mod_name:ident: $feature_name:literal, )*) => {
        $(
            #[cfg(feature = $feature_name)]
            pub mod $mod_name;
        )*
    };
}

modules! (
    array: "array",
    convert: "convert",
    collections: "collections",
    mem: "mem",
    sync: "sync",
    vec: "vec",
);