Mastodon Feed: Post

Mastodon Feed

rust@octodon.social ("Rust tips") wrote:

Avoid surprising errors caused by types implicitly borrowing temporary data. Add this to the top of your src/lib.rs file:

#![warn(elided_lifetimes_in_paths)]

For backwards compatibility, #RustLang allows referring to types without mentioning they are bound by lifetimes, e.g. Cow<str> instead of Cow<'_, str>. This lint requires use of the more explicit syntax.