#box #generic #leak #memory #in-place #care #panic-safe

nightly bip

bip (Box in place) provides a fully generic in-place map for the Box type, taking care to be panic-safe and not leak memory

2 unstable releases

Uses old Rust 2015

0.1.0 Apr 22, 2015
0.0.1 Feb 18, 2015

#794 in Memory management

MIT/Apache

5KB
98 lines

bip

Build Status

bip (Box in place) provides a fully generic in-place map for the Box type, taking care to be panic-safe and not leak memory.

Example:

let x: Box<i32> = Box::new(1);
let y: Box<f32> = bip::map_in_place(y, |x| x as f32 + 1.0);

// y uses the same allocation as x

Documentation


lib.rs:

bip (Box in place) provides a fully generic in-place map for the Box type, taking care to be panic-safe and not leak memory.

Available on crates.io. Source.

No runtime deps