Expand description
If var
is a Box, this crate lets you use var.unbox_ref()
instead of &*var
for better readability.
Instead of
let box = Box::new("Hello, Box!".to_owned());
let ref_to_value = &*box;
this crate allows you to write
let box = Box::new("Hello, Box!".to_owned());
let ref_to_value = box.unbox_ref();
which can be easier to read and might help you avoid errors.
To use the crate, just import
use unbox_box::BoxExt as _;
and the methods will be available to any Box variable within your scope.
Traitsยง
- BoxExt
- Extends
Box
with the.unbox_ref()
and.unbox_mut()
methods.