From 80d772aa7fe21c980135b4c4b9b226454f510825 Mon Sep 17 00:00:00 2001 From: Adrian Papari Date: Sun, 22 Sep 2024 16:07:47 +0200 Subject: [PATCH] bump bon to 2.3.0 --- Cargo.toml | 2 +- examples/common/window.rs | 5 ++--- src/fx/fade.rs | 5 ++--- src/fx/glitch.rs | 8 +++----- src/fx/hsl_shift.rs | 5 ++--- src/fx/shader_fn.rs | 5 ++--- src/fx/slide.rs | 5 ++--- 7 files changed, 14 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3f54078..d7b63fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ authors = ["Adrian Papari "] exclude = ["images/*.gif", ".*"] [dependencies] -bon = "2.1.0" +bon = "2.3.0" colorsys = "0.6.7" ratatui = "0.28.1" simple-easing = "1.0.1" diff --git a/examples/common/window.rs b/examples/common/window.rs index c61fd02..fe7b335 100644 --- a/examples/common/window.rs +++ b/examples/common/window.rs @@ -1,4 +1,4 @@ -use bon::builder; +use bon::Builder; use ratatui::buffer::Buffer; use ratatui::layout::Rect; use ratatui::style::Style; @@ -8,8 +8,7 @@ use ratatui::widgets::Widget; use tachyonfx::{CellFilter, CellIterator, Duration, Effect, EffectTimer, Shader}; -#[derive(Clone)] -#[builder] +#[derive(Builder, Clone)] pub struct OpenWindow { title: Line<'static>, pre_render_fx: Option, // for setting up geometry etc diff --git a/src/fx/fade.rs b/src/fx/fade.rs index adae135..1454945 100644 --- a/src/fx/fade.rs +++ b/src/fx/fade.rs @@ -1,4 +1,4 @@ -use bon::builder; +use bon::{builder, Builder}; use ratatui::layout::Rect; use ratatui::prelude::Color; @@ -7,8 +7,7 @@ use crate::effect_timer::EffectTimer; use crate::shader::Shader; use crate::{CellFilter, CellIterator, Interpolatable}; -#[derive(Clone)] -#[builder] +#[derive(Builder, Clone)] pub struct FadeColors { fg: Option, bg: Option, diff --git a/src/fx/glitch.rs b/src/fx/glitch.rs index 11c0bb6..5d03479 100644 --- a/src/fx/glitch.rs +++ b/src/fx/glitch.rs @@ -1,4 +1,4 @@ -use bon::builder; +use bon::{builder, Builder}; use std::fmt::Debug; use std::ops::Range; @@ -17,8 +17,7 @@ pub enum GlitchType { // fixme: make non-public again } /// A glitch effect that can be applied to a cell. -#[derive(Clone, Debug)] -#[builder] +#[derive(Builder, Clone, Debug)] pub struct GlitchCell { cell_idx: usize, glitch_remaining_ms: u32, @@ -27,8 +26,7 @@ pub struct GlitchCell { } /// applies a glitch effect to random parts of the screen. -#[derive(Clone)] -#[builder] +#[derive(Builder, Clone)] pub struct Glitch { cell_glitch_ratio: f32, action_start_delay_ms: Range, diff --git a/src/fx/hsl_shift.rs b/src/fx/hsl_shift.rs index 1cb875d..1213d32 100644 --- a/src/fx/hsl_shift.rs +++ b/src/fx/hsl_shift.rs @@ -1,4 +1,4 @@ -use bon::builder; +use bon::{builder, Builder}; use ratatui::layout::Rect; use ratatui::style::Color; @@ -7,8 +7,7 @@ use crate::shader::Shader; use crate::CellFilter; use crate::{CellIterator, ColorMapper, HslConvertable, Interpolatable}; -#[derive(Clone, Default)] -#[builder] +#[derive(Builder, Clone, Default)] pub struct HslShift { #[builder(into)] timer: EffectTimer, diff --git a/src/fx/shader_fn.rs b/src/fx/shader_fn.rs index 8bf6f21..af59dcf 100644 --- a/src/fx/shader_fn.rs +++ b/src/fx/shader_fn.rs @@ -1,4 +1,4 @@ -use bon::{bon, builder}; +use bon::{bon, builder, Builder}; use ratatui::buffer::Buffer; use ratatui::layout::Rect; @@ -6,8 +6,7 @@ use crate::{ref_count, CellFilter, CellIterator, Duration, EffectTimer, RefCount use crate::fx::invoke_fn; use crate::ThreadSafetyMarker; -#[derive(Clone)] -#[builder] +#[derive(Builder, Clone)] pub struct ShaderFn { state: S, original_state: Option, diff --git a/src/fx/slide.rs b/src/fx/slide.rs index b5280c8..e265c3a 100644 --- a/src/fx/slide.rs +++ b/src/fx/slide.rs @@ -1,4 +1,4 @@ -use bon::builder; +use bon::{builder, Builder}; use ratatui::buffer::{Buffer, Cell}; use ratatui::layout::{Position, Rect}; use ratatui::style::Color; @@ -8,8 +8,7 @@ use crate::fx::{Direction, DirectionalVariance}; use crate::{CellFilter, CellIterator, Duration, EffectTimer, Shader}; /// A shader that applies a directional sliding effect to terminal cells. -#[derive(Clone)] -#[builder] +#[derive(Builder, Clone)] pub struct SlideCell { /// The color behind the sliding cell. color_behind_cell: Color,