diff --git a/crates/processing_pyo3/src/gltf.rs b/crates/processing_pyo3/src/gltf.rs index ec86a3c..6fcc6fd 100644 --- a/crates/processing_pyo3/src/gltf.rs +++ b/crates/processing_pyo3/src/gltf.rs @@ -48,4 +48,3 @@ impl Gltf { Ok(Light { entity }) } } - diff --git a/crates/processing_pyo3/src/lib.rs b/crates/processing_pyo3/src/lib.rs index f43a1cf..f8fc24b 100644 --- a/crates/processing_pyo3/src/lib.rs +++ b/crates/processing_pyo3/src/lib.rs @@ -17,7 +17,7 @@ pub(crate) mod shader; #[cfg(feature = "webcam")] mod webcam; -use graphics::{get_graphics, get_graphics_mut, Geometry, Graphics, Image, Light, Topology}; +use graphics::{Geometry, Graphics, Image, Light, Topology, get_graphics, get_graphics_mut}; use material::Material; use pyo3::{ @@ -111,6 +111,10 @@ fn detect_environment(py: Python<'_>) -> PyResult { mod mewnala { use super::*; + #[pymodule_export] + use super::Geometry; + #[pymodule_export] + use super::Gltf; #[pymodule_export] use super::Graphics; #[pymodule_export] @@ -118,15 +122,11 @@ mod mewnala { #[pymodule_export] use super::Light; #[pymodule_export] - use super::Topology; - #[pymodule_export] use super::Material; #[pymodule_export] - use super::Gltf; - #[pymodule_export] - use super::Geometry; - #[pymodule_export] use super::Shader; + #[pymodule_export] + use super::Topology; #[pymodule_export] const ROUND: u8 = 0; @@ -146,8 +146,8 @@ mod mewnala { #[pyfunction] #[pyo3(pass_module)] fn load_gltf(module: &Bound<'_, PyModule>, path: &str) -> PyResult { - let graphics = get_graphics(module)? - .ok_or_else(|| PyRuntimeError::new_err("call size() first"))?; + let graphics = + get_graphics(module)?.ok_or_else(|| PyRuntimeError::new_err("call size() first"))?; let entity = ::processing::prelude::gltf_load(graphics.entity, path) .map_err(|e| PyRuntimeError::new_err(format!("{e}")))?; Ok(Gltf::from_entity(entity)) diff --git a/crates/processing_render/src/lib.rs b/crates/processing_render/src/lib.rs index 99fece9..4592dc9 100644 --- a/crates/processing_render/src/lib.rs +++ b/crates/processing_render/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(clippy::module_inception)] + pub mod geometry; pub mod gltf; mod graphics; diff --git a/examples/animated_mesh.rs b/examples/animated_mesh.rs index 02d7ba2..cfe6d89 100644 --- a/examples/animated_mesh.rs +++ b/examples/animated_mesh.rs @@ -75,7 +75,7 @@ fn sketch() -> error::Result<()> { while glfw_ctx.poll_events() { for z in 0..grid_size { for x in 0..grid_size { - let idx = (z * grid_size + x) as u32; + let idx = z * grid_size + x; let px = x as f32 * spacing - offset; let pz = z as f32 * spacing - offset; let wave = (px * 0.1 + time).sin() * (pz * 0.1 + time).cos() * 20.0; diff --git a/examples/glfw.rs b/examples/glfw.rs index 55e3fda..5478e08 100644 --- a/examples/glfw.rs +++ b/examples/glfw.rs @@ -84,9 +84,8 @@ impl GlfwContext { self.glfw.poll_events(); for (_, event) in glfw::flush_messages(&self.events) { - match event { - WindowEvent::Close => return false, - _ => {} + if event == WindowEvent::Close { + return false; } } diff --git a/tools/generate_stubs/src/main.rs b/tools/generate_stubs/src/main.rs index 8852546..522bae1 100644 --- a/tools/generate_stubs/src/main.rs +++ b/tools/generate_stubs/src/main.rs @@ -41,8 +41,7 @@ fn main() { eprintln!("Introspecting: {}", cdylib_path.display()); - let module = - introspect_cdylib(&cdylib_path, "mewnala").expect("Failed to introspect cdylib"); + let module = introspect_cdylib(&cdylib_path, "mewnala").expect("Failed to introspect cdylib"); let stubs = module_stub_files(&module);