Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed Jun 8, 2024
1 parent cd2ac99 commit 3c98b17
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions flux/src/flux.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::render::texture;
use crate::{grid, render, rng, settings};
use settings::Settings;

Expand Down Expand Up @@ -58,7 +57,8 @@ impl Flux {
queue: &wgpu::Queue,
texture_view: wgpu::TextureView,
) {
self.lines.update_color_bindings(device, queue, Some(texture_view), None);
self.lines
.update_color_bindings(device, queue, Some(texture_view), None);
}

pub fn new(
Expand Down
2 changes: 1 addition & 1 deletion flux/src/render/color.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use image::{DynamicImage, GenericImage, GenericImageView, Rgba, RgbaImage};
use std::path;

pub enum Problem {
ReadImage(std::io::Error),
Expand All @@ -18,6 +17,7 @@ impl std::fmt::Display for Problem {
}

pub struct Context {
#[allow(dead_code)]
texture: wgpu::Texture,
pub texture_view: wgpu::TextureView,
}
Expand Down
10 changes: 5 additions & 5 deletions flux/src/render/lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl Context {
mapped_at_creation: false,
});

queue.write_buffer(&self.color_buffer, 0, &bytemuck::cast_slice(&[color_wheel]));
queue.write_buffer(&self.color_buffer, 0, bytemuck::cast_slice(&[color_wheel]));

self.color_mode = 1;
self.update_color_bindings(device, queue, None, None);
Expand All @@ -159,7 +159,7 @@ impl Context {
}

pub fn update_color_bindings(
self: &mut Self,
&mut self,
device: &wgpu::Device,
queue: &wgpu::Queue,
some_color_texture_view: Option<wgpu::TextureView>,
Expand Down Expand Up @@ -198,7 +198,7 @@ impl Context {

pub fn tick_line_uniforms(
&mut self,
device: &wgpu::Device,
_device: &wgpu::Device,
queue: &wgpu::Queue,
timestep: f32,
elapsed_time: f32,
Expand All @@ -212,7 +212,7 @@ impl Context {
);
}

pub fn update_line_color_mode(&mut self, device: &wgpu::Device, queue: &wgpu::Queue) {
pub fn update_line_color_mode(&mut self, _device: &wgpu::Device, queue: &wgpu::Queue) {
self.line_uniforms.color_mode = self.color_mode;

queue.write_buffer(
Expand Down Expand Up @@ -317,7 +317,7 @@ impl Context {

pub fn new(
device: &wgpu::Device,
queue: &wgpu::Queue,
_queue: &wgpu::Queue,
swapchain_format: wgpu::TextureFormat,
screen_size: wgpu::Extent3d,
grid: &Grid,
Expand Down
5 changes: 2 additions & 3 deletions flux/src/render/noise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl NoiseGenerator {
depth_or_array_layers: 1,
};

let (texture, texture_view) = create_texture(&device, &size);
let (texture, texture_view) = create_texture(device, &size);

self.scaling_ratio = scaling_ratio;
self.texture = texture;
Expand Down Expand Up @@ -484,8 +484,7 @@ impl NoiseUniforms {
scale: [
channel.scale * scaling_ratio.x(),
channel.scale * scaling_ratio.y(),
]
.into(),
],
offset_1: channel.offset_1,
offset_2: channel.offset_2,
blend_factor: channel.blend_factor,
Expand Down
7 changes: 3 additions & 4 deletions flux/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ impl Default for ColorMode {
}
}

impl Into<u32> for ColorMode {
fn into(self) -> u32 {
match self {
impl From<ColorMode> for u32 {
fn from(val: ColorMode) -> Self {
match val {
ColorMode::Preset(ColorPreset::Original) => 0,
ColorMode::Preset(_) => 1,
ColorMode::ImageFile(_) => 2,
Expand Down Expand Up @@ -152,4 +152,3 @@ pub static COLOR_SCHEME_POOLSIDE: [f32; 24] = [
124.0 / 255.0, 220.0 / 255.0, 236.0 / 255.0, 1.0,
156.0 / 255.0, 208.0 / 255.0, 236.0 / 255.0, 1.0,
];

0 comments on commit 3c98b17

Please sign in to comment.