Skip to content

Commit

Permalink
bump bon to 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
junkdog committed Sep 22, 2024
1 parent 9173aab commit 80d772a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ authors = ["Adrian Papari <junkdog@angelhill.net>"]
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"
Expand Down
5 changes: 2 additions & 3 deletions examples/common/window.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bon::builder;
use bon::Builder;
use ratatui::buffer::Buffer;
use ratatui::layout::Rect;
use ratatui::style::Style;
Expand All @@ -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<Effect>, // for setting up geometry etc
Expand Down
5 changes: 2 additions & 3 deletions src/fx/fade.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bon::builder;
use bon::{builder, Builder};
use ratatui::layout::Rect;
use ratatui::prelude::Color;

Expand All @@ -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<Color>,
bg: Option<Color>,
Expand Down
8 changes: 3 additions & 5 deletions src/fx/glitch.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bon::builder;
use bon::{builder, Builder};
use std::fmt::Debug;
use std::ops::Range;

Expand All @@ -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,
Expand All @@ -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<u32>,
Expand Down
5 changes: 2 additions & 3 deletions src/fx/hsl_shift.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bon::builder;
use bon::{builder, Builder};
use ratatui::layout::Rect;
use ratatui::style::Color;

Expand All @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions src/fx/shader_fn.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use bon::{bon, builder};
use bon::{bon, builder, Builder};
use ratatui::buffer::Buffer;
use ratatui::layout::Rect;

use crate::{ref_count, CellFilter, CellIterator, Duration, EffectTimer, RefCount, Shader};
use crate::fx::invoke_fn;
use crate::ThreadSafetyMarker;

#[derive(Clone)]
#[builder]
#[derive(Builder, Clone)]
pub struct ShaderFn<S: Clone> {
state: S,
original_state: Option<S>,
Expand Down
5 changes: 2 additions & 3 deletions src/fx/slide.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit 80d772a

Please sign in to comment.