Skip to main content

fixed

Function fixed 

Source
pub fn fixed(val: u128) -> impl FnMut(&State) -> u128
Expand description

A pre-canned delegate that always parrots a given value.

ยงExamples

use tinyrand::Rand;
use tinyrand_alloc::{Mock, fixed};

let mut mock = Mock::default().with_next_u128(fixed(42));
assert_eq!(42, mock.next_u64());
assert_eq!(42, mock.next_u64());