huonw / bip

In-place map for `Box`

Home Page:http://huonw.github.io/bip/bip/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

In-place map for `Box`

http://huonw.github.io/bip/bip/


Languages

Language:Rust 100.0%