pure_ref 0.1.3

A library for making immutable references only
Documentation
  • Coverage
  • 25%
    1 out of 4 items documented1 out of 4 items with examples
  • Size
  • Source code size: 2.65 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.33 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • lemonlambda

The purspose of this library is to provide a way to take a reference to a potentionally mutable variable. Potentially mutable meaning it could be mutable in a struct.

use pure_ref::Pure;

let pure = Pure::new(10);
let borrowed = pure.borrowed();
// or `let borrowed = *pure;`
assert_eq!(*borrowed, 10);