Skip to content

RS-LIFE0002 · examples

These examples come directly from RS-LIFE0002. Read their source.

struct Report { title: &'static str }
fn describe(name: &'static str) -> Report { ... }
struct Report { title: String }
fn describe(name: &str) -> Report { ... }
A `fn label(kind: Kind) -> &'static str` returning one of a fixed set of names is not reported,
because the names really do live in the binary and the caller gains by being told so.