bee-block 1.0.1

Implementation of the IOTA protocol block layouts
Documentation
1
2
3
4
5
6
7
8
9
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use crate::rand::bool::rand_bool;

/// Generates a random generic option.
pub fn rand_option<T>(inner: T) -> Option<T> {
    if rand_bool() { Some(inner) } else { None }
}