constptr 0.3.1

NonNull without mutability
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use constptr::ConstPtr;

#[test]
fn const_context() {
    let example = "const string";

    let _constptr = unsafe { ConstPtr::new_unchecked(example) };
}

#[test]
fn from_mut() {
    let mut example = 1234;

    #[allow(clippy::unnecessary_mut_passed)]
    let _constptr = ConstPtr::from(&mut example);
}