Add clippy, fix up warnings
This commit is contained in:
@@ -78,10 +78,9 @@ pub fn main() -> Result<()> {
|
||||
image.save(temp.path()).context("Unable to save image")?;
|
||||
|
||||
let open_program: &str = cfg_select! {
|
||||
unix => Some("xdg-open"),
|
||||
_ => None,
|
||||
}
|
||||
.expect("No available program to open images");
|
||||
unix => "xdg-open",
|
||||
_ => panic!("No available program to open images")
|
||||
};
|
||||
|
||||
Command::new(open_program)
|
||||
.arg(temp.path())
|
||||
|
||||
@@ -26,14 +26,14 @@ impl Camera {
|
||||
///
|
||||
/// * `dimensions` - Width and height of the output image (in pixels).
|
||||
/// * `center` - Location of the origin in IFS coordinates. Positive `x` shifts the image
|
||||
/// left, and positive `y` position shifts the image up.
|
||||
/// left, and positive `y` position shifts the image up.
|
||||
/// * `rotate` - Rotation angle (in radians) of IFS coordinates. Rotation is applied after the
|
||||
/// `center` translation, so it is about the new origin.
|
||||
/// `center` translation, so it is about the new origin.
|
||||
/// * `zoom` - Zoom factor applied to IFS coordinates. IFS coordinates are scaled by
|
||||
/// `pow(2, zoom)`, so a zoom factor of 0 is the identity.
|
||||
/// `pow(2, zoom)`, so a zoom factor of 0 is the identity.
|
||||
/// * `scale` - Pixels per unit of IFS coordinates. This parameter is usually chosen such
|
||||
/// that the largest dimension will cover the range `[-2, 2]`, but values higher or lower
|
||||
/// can be used as a secondary zoom.
|
||||
/// that the largest dimension will cover the range `[-2, 2]`, but values higher or lower
|
||||
/// can be used as a secondary zoom.
|
||||
pub fn new(dimensions: UVec2, center: Vec2, rotate: f32, zoom: Vec2, scale: Vec2) -> Camera {
|
||||
let ifs_center_transform = Affine2::from_translation(-center);
|
||||
let zoom_transform = Affine2::from_scale(vec2(powf(2.0, zoom.x), powf(2.0, zoom.y)));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
//! # Enkou
|
||||
#![no_std]
|
||||
#![warn(missing_docs)]
|
||||
#![deny(missing_docs)]
|
||||
#![allow(clippy::needless_range_loop)] // SPIR-V backend has issues with iteration over items
|
||||
|
||||
pub mod camera;
|
||||
pub mod chaos_game;
|
||||
|
||||
@@ -24,7 +24,7 @@ pub(crate) fn xoshiro256starstar_from_seed(
|
||||
// - `u64::from_le_bytes` has issues with `OpBitcast` in SPIR-V validation
|
||||
for i in 0..rng_state_actual.len() {
|
||||
for j in 0..size_of::<u64>() {
|
||||
rng_state_actual[i] |= (rng_state[i * size_of::<u64>() + j] as u64) << j * 8;
|
||||
rng_state_actual[i] |= (rng_state[i * size_of::<u64>() + j] as u64) << (j * 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ impl Transform {
|
||||
let variation_start = self.variation_range.x;
|
||||
let variation_end = self.variation_range.y;
|
||||
for variation_index in variation_start..variation_end {
|
||||
let ref variation = variations[variation_index as usize];
|
||||
let variation = &variations[variation_index as usize];
|
||||
point_output += variation.transform_point(point, rng, &self.coefficients)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user