Silence some clippy warnings on generated code and large preformatted data.

This commit is contained in:
Nathan Vegdahl 2018-12-08 13:21:41 -08:00
parent ea75e3ed21
commit e9b495e729
5 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,8 @@
#![allow(dead_code)] #![allow(dead_code)]
#![allow(clippy::cast_lossless)]
#![allow(clippy::excessive_precision)]
#![allow(clippy::unreadable_literal)]
#![allow(clippy::needless_return)]
// Include the file generated by the build.rs script // Include the file generated by the build.rs script
include!(concat!(env!("OUT_DIR"), "/halton.rs")); include!(concat!(env!("OUT_DIR"), "/halton.rs"));

View File

@ -45,7 +45,7 @@ pub fn sample_with_scramble(dimension: u32, mut index: u32, scramble: u32) -> f3
i += 1; i += 1;
} }
return result as f32 * (1.0 / (1u64 << 32) as f32); result as f32 * (1.0 / (1u64 << 32) as f32)
} }
#[inline] #[inline]

View File

@ -28,6 +28,8 @@
// The tabulated direction numbers are available here: // The tabulated direction numbers are available here:
// http://web.maths.unsw.edu.au/~fkuo/sobol/new-joe-kuo-6.21201 // http://web.maths.unsw.edu.au/~fkuo/sobol/new-joe-kuo-6.21201
#![allow(clippy::unreadable_literal)]
pub const NUM_DIMENSIONS: usize = 1024; pub const NUM_DIMENSIONS: usize = 1024;
pub const SIZE: usize = 52; pub const SIZE: usize = 52;

View File

@ -779,8 +779,9 @@ def write_output(data_points, grid, grid_res, filename):
f.write('// This file is auto-generated by generate_spectra_tables.py\n') f.write('// This file is auto-generated by generate_spectra_tables.py\n')
f.write('#![allow(dead_code)]\n') f.write('#![allow(dead_code)]\n')
f.write('#![cfg_attr(rustfmt, rustfmt_skip)]') f.write('#![cfg_attr(rustfmt, rustfmt_skip)]\n')
f.write('\n\n') f.write('#![allow(clippy::unreadable_literal)]\n')
f.write('\n')
f.write('/// This is 1 over the integral over either CMF.\n') f.write('/// This is 1 over the integral over either CMF.\n')
f.write('/// Spectra can be mapped so that xyz=(1,1,1) is converted to constant 1 by\n') f.write('/// Spectra can be mapped so that xyz=(1,1,1) is converted to constant 1 by\n')
f.write('/// dividing by this value. This is important for valid reflectances.\n') f.write('/// dividing by this value. This is important for valid reflectances.\n')

View File

@ -1,6 +1,7 @@
// This file is auto-generated by generate_spectra_tables.py // This file is auto-generated by generate_spectra_tables.py
#![allow(dead_code)] #![allow(dead_code)]
#![cfg_attr(rustfmt, rustfmt_skip)] #![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(clippy::unreadable_literal)]
/// This is 1 over the integral over either CMF. /// This is 1 over the integral over either CMF.
/// Spectra can be mapped so that xyz=(1,1,1) is converted to constant 1 by /// Spectra can be mapped so that xyz=(1,1,1) is converted to constant 1 by