Clippy errors solved

pull/59/head
AlessandroBregoli 2 years ago
parent 8163bfb2b0
commit a07dc214ce
  1. 4
      src/sampling.rs
  2. 3
      src/tools.rs

@ -1,5 +1,5 @@
use crate::{ use crate::{
network::{self, Network}, network::{Network},
params::{self, ParamsTrait}, params::{self, ParamsTrait},
}; };
use rand::SeedableRng; use rand::SeedableRng;
@ -22,7 +22,7 @@ where
impl<'a, T: Network> ForwardSampler<'a, T> { impl<'a, T: Network> ForwardSampler<'a, T> {
pub fn new(net: &'a T, seed: Option<u64>) -> ForwardSampler<'a, T> { pub fn new(net: &'a T, seed: Option<u64>) -> ForwardSampler<'a, T> {
let mut rng: ChaCha8Rng = match seed { let rng: ChaCha8Rng = match seed {
//If a seed is present use it to initialize the random generator. //If a seed is present use it to initialize the random generator.
Some(seed) => SeedableRng::seed_from_u64(seed), Some(seed) => SeedableRng::seed_from_u64(seed),
//Otherwise create a new random generator using the method `from_entropy` //Otherwise create a new random generator using the method `from_entropy`

@ -1,8 +1,5 @@
use ndarray::prelude::*; use ndarray::prelude::*;
use rand_chacha::rand_core::SeedableRng;
use rand_chacha::ChaCha8Rng;
use crate::params::ParamsTrait;
use crate::sampling::{Sampler, ForwardSampler}; use crate::sampling::{Sampler, ForwardSampler};
use crate::{network, params}; use crate::{network, params};

Loading…
Cancel
Save