You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: number.rs
    path of file: ./repos/synth/core/src/graph
    
    the code of the file until where you have to start completion: #![allow(clippy::assertions_on_result_states)]
use super::prelude::*;

use rand::distributions::uniform::SampleRange;

use num::{CheckedAdd, One, Zero};

use std::ops::{Bound, RangeBounds};

/// A custom extension of all the range types that uses
/// [`Bound`](std::ops::Bound) on the left and on the right.
#[derive(Clone)]
struct AnyRange<N> {
    low: Bound<N>,
    high: Bound<N>,
}

macro_rules! any_range_int_impl {
    { $target:ty } => {
        impl AnyRange<$target> {
            fn is_empty(&self) -> bool {
                match (&self.low, &self.high) {
                    (Bound::Excluded(low), Bound::Included(high))
                        | (Bound::Included(low), Bound::Excluded(high)) => low >= high,
                    (Bound::Included(low), Bound::Included(high)) => low > high,
                    (Bound::Excluded(low), Bound::Excluded(high)) => *low + 1 >= *high,
                    _ => false
                }
            }
        }

        impl
    
            pub fn try_from_range(range_step: RangeStep<$target>) -> anyhow::Result<Self> {
                let low = range_step.low.unwrap_or(<$target>::MIN);
                let high = range_step.high.unwrap_or(<$target>::MAX);
                if low > high {
                    return Err(anyhow!("integer range cannot have 'low'={} > 'high'={}", low, high))
                }

                let delta = ((high as $larger) - (low as $larger)) as $unsigned;

                let step_unchecked = range_step.step.unwrap_or(1);

                #[allow(unused_comparisons)]
                if step_unchecked == 0 {
                    return Err(anyhow!("integer range 'step'=0 is invalid, use the constant generator instead"))
                } else if step_unchecked < 0 {
                    return Err(anyhow!("integer range 'step'={} is invalid, use a positive value instead", step_unchecked))
                }

                let step = step_unchecked as $unsigned;

                let include_low = range_step.include_low;
                let include_high = range_step.include_high;

                let delta_include_high = if delta % step == 0 {
                    include_high
                } else {
                    true
                };

                let delta_high = into_finite_bound(delta / step, delta_include_high);
                let delta_low = into_finite_bound(0, include_low);
                let range = AnyRange::from_range_bounds(&(delta_low, delta_high));

                if range.is_empty() {
                    let original = AnyRange::from_range_bounds(&range_step);
                    Err(anyhow!("{} range with {} step={} is empty", stringify!($target), original, step))
                } else {
                    Ok(Self { range, low: low as $larger, step })
                }
            }