Skip to content

Instantly share code, notes, and snippets.

@ryanpeach
Last active November 3, 2024 05:08
Show Gist options
  • Save ryanpeach/bb6734cd0596866def07f1cdc4dd10d6 to your computer and use it in GitHub Desktop.
Save ryanpeach/bb6734cd0596866def07f1cdc4dd10d6 to your computer and use it in GitHub Desktop.
My favorite rust packages and settings
[profile.dev]
opt-level = 0
debug = true
[profile.release]
opt-level = 3
debug = false
[dependencies]
# Errors
thiserror = "*"
miette = "*" # Print errors like rust does
# Derivers
bon = "*"
getset = "*"
derive_more = { version = "*", features = ["full"] }
validator = "*" # Like pydantic
soa_derive = "*" # Struct of Arrays and Array of Struct converter
# CLI and Config
clap = "*" # Create CLI's
serde = "*" # Serialization
serde_derive = "*"
serde_yaml = "*"
serde_json = "*"
serde_toml = "*"
tracing = "*"
# Iteration
rayon = "*" # Parallelize anything
itertools = "*" # Like in python
indicatif = "*" # Progress Bar
# Numbers
ndarray = { version = "*", features = ["rayon", "serde", "blas"] }
rand = "*"
ordered-float = "*" # NotNaN and OrderedFloat for sorting
uom = "*" # Compile Time Units of Measure (Like meters, seconds, etc)
conv = "*" # Better conversions
# Faster than default
iota = "*" # Prints Integers faster
ryu = "*" # Prints floats faster
hashbrown = { version = "*", features = ["rayon", "ahash"] } # Faster hashmap
# Enums and Strings
strum = "*"
strum_macros = "*"
[dev-dependencies]
just = "*"
pretty_assertions = "*"
proptest = "*"
iai-callgrind = "*"
[[bench]]
name = "bench_main"
harness = false
[profile.bench]
debug = true
[toolchain]
channel = "stable"
components = ["clippy"]
[lints.rust]
missing_docs = "deny"
[lints.rustdoc]
missing_crate_level_docs = "warn"
unescaped_backticks = "warn"
private_intra_doc_links = "allow"
[lints.clippy]
# Enable specific Clippy lints
pedantic = { level = "warn", priority = -1 }
unwrap_used = "warn"
panic = "warn"
trivially_copy_pass_by_ref = "warn"
inefficient_to_string = "warn"
missing_docs_in_private_items = "warn"
doc_markdown = "warn"
missing_fields_in_debug = "warn"
redundant_clone = "warn"
# Deny these lints
cast_possible_truncation = "deny"
cast_precision_loss = "deny"
# Allow these lints
too_many_lines = "allow"
missing_errors_doc = "allow" # These are in the return type
similar_names = "allow"
missing_panics_doc = "allow" # WARNING: Only include for binary-primary projects
module_name_repetitions = "allow"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment