Merge pull request 'Add clippy, fix up warnings' (#7) from clippy into main
Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
@@ -21,7 +21,10 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
components: clippy
|
||||
- run: cargo check --all-targets
|
||||
- run: cargo clippy --all-targets
|
||||
- run: cargo test
|
||||
|
||||
test-gpu:
|
||||
@@ -30,5 +33,5 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
- run: cargo install --git https://github.com/rust-gpu/rust-gpu cargo-gpu
|
||||
- run: cargo install --git https://github.com/rust-gpu/rust-gpu cargo-gpu --rev 67f1ff2
|
||||
- run: cargo gpu check --auto-install-rust-toolchain -p enkou-shaders
|
||||
|
||||
@@ -19,15 +19,12 @@ mod test {
|
||||
}
|
||||
|
||||
fn has_entry_point(execution_model: ExecutionModel, name: &str) -> bool {
|
||||
for ref entry_point in shader().entry_points.iter() {
|
||||
for entry_point in shader().entry_points.iter() {
|
||||
let operands: Vec<Operand> = entry_point
|
||||
.operands
|
||||
.iter()
|
||||
.filter(|op| match op {
|
||||
Operand::ExecutionModel(_) | Operand::LiteralString(_) => true,
|
||||
_ => false,
|
||||
})
|
||||
.map(|op| op.clone())
|
||||
.filter(|op| matches!(op, Operand::ExecutionModel(_) | Operand::LiteralString(_)))
|
||||
.cloned()
|
||||
.collect();
|
||||
|
||||
assert_eq!(operands.len(), 2);
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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