Follow

How to avoid lifetimes annotations in Rust 🦀

kerkour.com/blog/rust-avoid-li

Lifetime annotations are one of the things that distract the most new rustaceans. Here is my strategy to avoid them and write clean code

@sylvain There are good reasons for lifetimes surfacing in APIs, eg. when safety guarantees require that objects have unique types. Then, it is important to document these (`'a` won't cut it). Example I recently updated: rustdoc.etonomy.org/riot_wrapp (although it also falls in your "embedded" category, on a platform where no library should alloc).

Sign in to participate in the conversation
Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!