hoist_temporaries

Procedural macro to extend the lifetimes of temporary variables.

crates.io Documentation Build Status

Examples

See working examples for more examples.

```rust use hoisttemporaries::hoisttemporaries;

[hoist_temporaries(snack)]

fn main() { let mut snack = "Cheese"; if true { // Without hoisttemporaries, this would error because the format!() returns a temporary which would otherwise be dropped because it has no owner. snack = &format!("{}burger", snack); } asserteq!(snack, "Cheeseburger"); } ```