Add clippy, fix up warnings
CI / cargo fmt (push) Successful in 23s
CI / cargo test (push) Successful in 12m44s
CI / cargo test (GPU) (push) Successful in 16m32s

This commit is contained in:
2026-07-12 14:45:46 -04:00
parent 08ada94bd2
commit 9ea4261a84
7 changed files with 19 additions and 19 deletions
+3 -4
View File
@@ -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())
+5 -5
View File
@@ -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)));
+2 -1
View File
@@ -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;
+1 -1
View File
@@ -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);
}
}
+1 -1
View File
@@ -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)
}