Skip to main content

non_zero_i64

Function non_zero_i64 

Source
pub fn non_zero_i64() -> NonZeroI64
Expand description

Create a new NonZero<i64> mutator.

ยงExample

use mutatis::{mutators as m, Mutate, Session};
use core::num::NonZero;

let mut mutator = m::non_zero_i64();
let mut session = Session::new();

let mut value = NonZero::<i64>::new(42).unwrap();
for _ in 0..5 {
    session.mutate_with(&mut mutator, &mut value)?;
    println!("value = {value}");
}

// Example output:
//
//     value = 190
//     value = 101
//     value = 49
//     value = 160
//     value = 99