macro-toolset 0.8.0-rc.2

Some useful macros
Documentation
[package]
name = "macro-toolset"
version = "0.8.0-rc.2"
edition = "2021"
rust-version = "1.66.0"

# === Publication info ===
authors = ["Hantong Chen <cxwdyx620@gmail.com>"]
categories = ["development-tools"]
description = "Some useful macros"
keywords = ["macro", "string"]
license = "GPL-3.0-only"
readme = "README.md"
repository = "https://github.com/cxw620/macro-toolset"

[package.metadata.docs.rs]
features = ["dev"]

[dependencies]
# Dev
base64 = { version = "0.22.0", optional = true }
bytes = { version = "1.2.0", optional = true }
rand = { version = "0.8.5", default-features = false, features = ["std", "std_rng"], optional = true }
ryu = { version = "1.0.0", optional = true }

# Encryption
const-hex = { version = "1.14.0", optional = true, default-features = false } # MSRV 1.64.0
foldhash = { version = "0.1.0", optional = true }

# Integration
ammonia = { version = "4.0.0", optional = true }
axum-core = { version = "0.4.0", optional = true }
chrono = { version = "0.4.20", optional = true, default-features = false, features = ["alloc"] }
http = { version = "1.0.0", optional = true }

[dev-dependencies]
bytes = "1.9.0"
const-hex = "1.14.0"
criterion = "0.5.1"
md-5 = "0.10.6"
rand = "0.8.5"
sha2 = "0.10.8"

[features]
default = ["feat-random", "feat-string"]

# Dev all
dev = [
    "feat-base64",
    "feat-hash",
    "feat-random-fast",
    "feat-string",
    "feat-string-ext-ammonia",
    "feat-string-ext-axum",
    "feat-string-ext-base64",
    "feat-string-ext-bytes",
    "feat-string-ext-chrono",
    "feat-string-ext-hex",
    "feat-string-ext-http",
    "feat-string-ext-rand",
    "feat-string-ext-ryu",
]

# Base64 related
feat-base64 = ["dep:base64"]

# Hash related
feat-hash = ["dep:const-hex"]

# Random related
feat-random = []
feat-random-fast = ["feat-random", "dep:foldhash"]

# StringExt related
feat-string = []
feat-string-ext-ammonia = ["dep:ammonia"]
feat-string-ext-axum = ["dep:axum-core", "dep:bytes"]
feat-string-ext-base64 = ["dep:base64"]
feat-string-ext-bytes = ["dep:bytes"]
feat-string-ext-chrono = ["dep:chrono"]
feat-string-ext-hex = ["dep:const-hex"]
feat-string-ext-http = ["dep:bytes", "dep:http"]
feat-string-ext-rand = ["feat-random", "dep:rand"]
feat-string-ext-ryu = ["dep:ryu"]

# === Benchmarks ===
[profile.bench]
opt-level = 3
lto = true
codegen-units = 1
incremental = false
strip = true

[[bench]]
name = "hex_string"
path = "benches/hex_string.rs"
harness = false

[[bench]]
name = "rand_string"
path = "benches/rand_string.rs"
harness = false

[[bench]]
name = "str_concat"
path = "benches/str_concat.rs"
harness = false

# === Lints config ===

[lints.rust]
unsafe_code = "warn"
missing_docs = "warn"
missing_debug_implementations = "warn"
unreachable_pub = "warn"

# Only works in nightly channel, use `cargo +nightly clippy --fix --allow-dirty --allow-staged`

[lints.clippy]
# See: https://rust-lang.github.io/rust-clippy/master/index.html for more details.

# Checks for attributes that allow lints without a reason.
allow_attributes_without_reason = "warn"
# Checks for `assert!(r.is_ok())` or `assert!(r.is_err())` calls, just `unwrap()` instead.
assertions_on_result_states = "warn"
# Checks for code like `foo = bar.clone()`; use `Clone::clone_from()` instead.
assigning_clones = "warn"
# Instead of using an if statement to convert a bool to an int, this lint suggests using a from() function or an as coercion.
bool_to_int_with_if = "warn"
# Checks for methods with high cognitive complexity.
cognitive_complexity = "warn"
# Checks usage of std::fs::create_dir and suggest using std::fs::create_dir_all instead.
create_dir = "warn"
# Checks for usage of the dbg! macro.
dbg_macro = "warn"
# Checks for function/method calls with a mutable parameter in debug_assert!, debug_assert_eq! and debug_assert_ne! macros.
# Mutating something in a debug_assert! macro results in different behavior between a release and debug build.
debug_assert_with_mut_call = "warn"
# Checks for literal calls to `Default::default()`. Use `$type::default()` instead.
default_trait_access = "warn"
# Checks for types that derive PartialEq and could implement Eq.
# derive_partial_eq_without_eq = "warn"
# Checks for usage of unicode scripts other than those explicitly allowed by the lint config.
disallowed_script_idents = "deny"
# Detects the syntax ['foo'] in documentation comments (notice quotes instead of backticks) outside of code blocks
doc_link_with_quotes = "warn"
# Checks for the presence of _, :: or camel-case words outside ticks in documentation.
doc_markdown = "warn"
# Checks for usage of if expressions with an else if branch, but without a final else branch.
else_if_without_else = "deny"
# Checks for use Enum::*.
enum_glob_use = "warn"
# is_file doesn’t cover special file types in unix-like systems, and doesn’t cover symlink in windows.
# Using !FileType::is_dir() is a better way
filetype_is_file = "warn"
# Checks for usage of .to_string() on an &&T where T implements ToString directly (like &&str or &&String).
inefficient_to_string = "warn"
# Checks for usage of std::mem::forget(t) where t is Drop or has a field that implements Drop.
mem_forget = "warn"
# Checks the doc comments of publicly visible functions that return a Result type and warns if there is no # Errors section.
# missing_errors_doc = "warn"
# Checks the doc comments of publicly visible functions that may panic and warns if there is no # Panics section.
missing_panics_doc = "warn"
# Checks that module layout uses only self named module files; bans mod.rs files.
mod_module_files = "deny"
# Checks for multiple inherent implementations of a struct
multiple_inherent_impl = "warn"
# Checks for usage of Mutex<X> where an atomic will do.
mutex_atomic = "warn"
# Checks for usage of Mutex<X> where X is an integral type. Use Atomic instead.
mutex_integer = "warn"
# The lint checks for if-statements appearing in loops that contain a continue statement in either their main blocks or their else-blocks, 
# when omitting the else-block possibly with some rearrangement of code can make the code easier to understand.
needless_continue = "warn"
# Checks for usage of panic!.
panic = "warn"
# Checks for temporaries returned from function calls in a match scrutinee that have the clippy::has_significant_drop attribute.
significant_drop_in_scrutinee = "warn"
# Checks for usage of todo!.
todo = "warn"
# Checks for usage of unimplemented!.
unimplemented = "warn"
# Checks for usage of unreachable!.
# unreachable = "warn"
# Checks for wildcard dependencies in the Cargo.toml.
wildcard_dependencies = "deny"
# Checks for wildcard imports use _::*
wildcard_imports = "warn"