Fixed warnings

This commit is contained in:
Victor Koenders 2018-06-08 14:01:26 +02:00
parent cdb0e8c8a1
commit df4f27e40e
5 changed files with 11 additions and 8 deletions

View file

@ -19,7 +19,7 @@ macro_rules! bench_binop {
fn $name(bh: &mut Bencher) { fn $name(bh: &mut Bencher) {
const LEN: usize = 1 << 13; const LEN: usize = 1 << 13;
let mut rng = IsaacRng::new_unseeded(); let mut rng = IsaacRng::from_entropy();
let elems1: Vec<$t1> = (0..LEN).map(|_| rng.gen::<$t1>()).collect(); let elems1: Vec<$t1> = (0..LEN).map(|_| rng.gen::<$t1>()).collect();
let elems2: Vec<$t2> = (0..LEN).map(|_| rng.gen::<$t2>()).collect(); let elems2: Vec<$t2> = (0..LEN).map(|_| rng.gen::<$t2>()).collect();
@ -42,7 +42,7 @@ macro_rules! bench_unop {
fn $name(bh: &mut Bencher) { fn $name(bh: &mut Bencher) {
const LEN: usize = 1 << 13; const LEN: usize = 1 << 13;
let mut rng = IsaacRng::new_unseeded(); let mut rng = IsaacRng::from_entropy();
let mut elems: Vec<$t> = (0..LEN).map(|_| rng.gen::<$t>()).collect(); let mut elems: Vec<$t> = (0..LEN).map(|_| rng.gen::<$t>()).collect();
let mut i = 0; let mut i = 0;
@ -64,7 +64,7 @@ macro_rules! bench_construction {
fn $name(bh: &mut Bencher) { fn $name(bh: &mut Bencher) {
const LEN: usize = 1 << 13; const LEN: usize = 1 << 13;
let mut rng = IsaacRng::new_unseeded(); let mut rng = IsaacRng::from_entropy();
$(let $args: Vec<$types> = (0..LEN).map(|_| rng.gen::<$types>()).collect();)* $(let $args: Vec<$types> = (0..LEN).map(|_| rng.gen::<$types>()).collect();)*
let mut i = 0; let mut i = 0;

View file

@ -14,12 +14,13 @@
// limitations under the License. // limitations under the License.
#![feature(test)] #![feature(test)]
#![allow(unused_macros)]
extern crate cgmath; extern crate cgmath;
extern crate rand; extern crate rand;
extern crate test; extern crate test;
use rand::{IsaacRng, Rng}; use rand::{IsaacRng, Rng, FromEntropy};
use test::Bencher; use test::Bencher;
use cgmath::*; use cgmath::*;
@ -30,7 +31,7 @@ mod macros;
fn bench_from_axis_angle<T: Rotation3<f32>>(bh: &mut Bencher) { fn bench_from_axis_angle<T: Rotation3<f32>>(bh: &mut Bencher) {
const LEN: usize = 1 << 13; const LEN: usize = 1 << 13;
let mut rng = IsaacRng::new_unseeded(); let mut rng = IsaacRng::from_entropy();
let axis: Vec<_> = (0..LEN).map(|_| rng.gen::<Vector3<f32>>()).collect(); let axis: Vec<_> = (0..LEN).map(|_| rng.gen::<Vector3<f32>>()).collect();
let angle: Vec<_> = (0..LEN).map(|_| rng.gen::<Rad<f32>>()).collect(); let angle: Vec<_> = (0..LEN).map(|_| rng.gen::<Rad<f32>>()).collect();

View file

@ -14,12 +14,13 @@
// limitations under the License. // limitations under the License.
#![feature(test)] #![feature(test)]
#![allow(unused_macros)]
extern crate cgmath; extern crate cgmath;
extern crate rand; extern crate rand;
extern crate test; extern crate test;
use rand::{IsaacRng, Rng}; use rand::{IsaacRng, Rng, FromEntropy};
use std::ops::*; use std::ops::*;
use test::Bencher; use test::Bencher;

View file

@ -19,7 +19,7 @@ extern crate cgmath;
extern crate rand; extern crate rand;
extern crate test; extern crate test;
use rand::{IsaacRng, Rng}; use rand::{IsaacRng, Rng, FromEntropy};
use std::ops::*; use std::ops::*;
use test::Bencher; use test::Bencher;

View file

@ -14,12 +14,13 @@
// limitations under the License. // limitations under the License.
#![feature(test)] #![feature(test)]
#![allow(unused_macros)]
extern crate cgmath; extern crate cgmath;
extern crate rand; extern crate rand;
extern crate test; extern crate test;
use rand::{IsaacRng, Rng}; use rand::{IsaacRng, Rng, FromEntropy};
use std::ops::*; use std::ops::*;
use test::Bencher; use test::Bencher;