diff options
author | Julian T <julian@jtle.dk> | 2021-02-10 23:06:48 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-02-10 23:06:48 +0100 |
commit | 49c6adb0db70ffc30eaac33b66eacf7574b34e26 (patch) | |
tree | 60f828ce8abf962fe2d88fdeb4e04db1d7663253 /src/sample/uniform.rs | |
parent | 3a144c8c1fc83150fc06d792082db5cc4bce3cc5 (diff) |
Fixed most clippy warnings
Diffstat (limited to 'src/sample/uniform.rs')
-rw-r--r-- | src/sample/uniform.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sample/uniform.rs b/src/sample/uniform.rs index e2f0b7c..2cd3156 100644 --- a/src/sample/uniform.rs +++ b/src/sample/uniform.rs @@ -13,6 +13,12 @@ pub struct UniformSampler { impl UniformSampler { pub fn new() -> Self { + Self::default() + } +} + +impl Default for UniformSampler { + fn default() -> Self { Self { r: Pcg32::seed_from_u64(1), d: Uniform::new(0.0, 1.0), @@ -22,7 +28,6 @@ impl UniformSampler { impl Sampler for UniformSampler { fn get_sample(&mut self) -> Float { - let sample = self.d.sample(&mut self.r); - sample + self.d.sample(&mut self.r) } } |