What are your favorite tricks or hacks in rust?

This page summarizes the projects mentioned and recommended in the original post on /r/rust

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • rust

    Empowering everyone to build reliable and efficient software.

  • It doesn't make sense to pass a generator to std::iter::from_fn() because from_fn excepts a function that returns Option, whereas a generator is a value that just implements the Generator trait. However: with a generator you shouldn't need from_fn() because you can write a trivial adapter that creates a real iterator from it (stolen from #60062):

  • rust-script

    Run Rust files and expressions as scripts without any setup or compilation step.

  • This is maybe a different kind of hack, but I recently learned about https://rust-script.org so you can write "scripts" in Rust instead of bash, Perl, Python, w/e

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • async-trait

    Type erasure for async trait methods

  • Does async-trait count as a trick or hack? It's not my hack, but it's a workaround/hack that I use every single day.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Why is Rust always advertised as system programming not general purpose programming?

    3 projects | /r/rust | 3 Dec 2022
  • Has anyone had any experience using PGO + BOLT for performance?

    2 projects | /r/rust | 8 Oct 2022
  • A major refactor of Rust's IP address representation has just been merged

    3 projects | /r/rust | 31 Jul 2022
  • Is there a tool to remove unused dependencies from a Cargo file?

    3 projects | /r/rust | 7 Apr 2022
  • How does libtest know which functions are marked with #[test]?

    2 projects | /r/rust | 20 Mar 2022