Skip to content

Commit

Permalink
refactor: make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Aloxaf committed Nov 22, 2023
1 parent 322db8f commit ba1ea1b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ pub struct HighlightingAssets {
pub theme_set: ThemeSet,
}

impl Default for HighlightingAssets {
fn default() -> Self {
Self::new()
}
}

impl HighlightingAssets {
pub fn new() -> Self {
Self::from_dump_file().unwrap_or_else(|_| Self {
Expand Down
8 changes: 4 additions & 4 deletions src/blur.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ pub fn gaussian_blur(image: RgbaImage, sigma: f32) -> RgbaImage {
RgbaImage::from_raw(width, height, raw).unwrap()
}

fn gaussian_blur_impl(data: &mut Vec<[u8; 4]>, width: usize, height: usize, blur_radius: f32) {
fn gaussian_blur_impl(data: &mut [[u8; 4]], width: usize, height: usize, blur_radius: f32) {
let bxs = create_box_gauss(blur_radius, 3);
let mut backbuf = data.clone();
let mut backbuf = data.to_vec();

box_blur(
&mut backbuf,
Expand Down Expand Up @@ -103,8 +103,8 @@ fn create_box_gauss(sigma: f32, n: usize) -> Vec<i32> {
/// Needs 2x the same image
#[inline]
fn box_blur(
backbuf: &mut Vec<[u8; 4]>,
frontbuf: &mut Vec<[u8; 4]>,
backbuf: &mut [[u8; 4]],
frontbuf: &mut [[u8; 4]],
width: usize,
height: usize,
blur_radius: usize,
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub(crate) fn add_window_controls(image: &mut DynamicImage, params: &WindowContr

let mut title_bar = RgbaImage::from_pixel(params.width * 3, params.height * 3, background);
let step = (params.radius * 2) as i32;
let spacer = (step * 2) as i32;
let spacer = step * 2;
let center_y = (params.height / 2) as i32;

for (i, (fill, outline)) in color.iter().enumerate() {
Expand Down

0 comments on commit ba1ea1b

Please sign in to comment.