Skip to content

Commit 4920457

Browse files
committed
Merge branch 'ratatui'
2 parents c15f8db + 25356a3 commit 4920457

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ parking_lot = { version = "0.12.1", optional = true, default-features = false }
7272
log = { version = "0.4.8", optional = true }
7373

7474
# render-tui
75-
tui = { version = "0.19.0", optional = true, default-features = false }
76-
tui-react = { version = "0.19.0", optional = true }
75+
tui = { package = "ratatui", version = "0.20.1", optional = true, default-features = false }
76+
tui-react = { version = "0.20.0", optional = true }
7777
futures-core = { version = "0.3.4", optional = true, default-features = false }
7878
futures-lite = { version = "1.5.0", optional = true }
7979
humantime = { version = "2.0.0", optional = true }
8080
unicode-segmentation = { version = "1.6.0", optional = true }
8181
unicode-width = { version = "0.1.7", optional = true }
82-
crosstermion = { version = "0.10.1", optional = true, default-features = false }
82+
crosstermion = { version = "0.11.0", optional = true, default-features = false }
8383
async-io = { version = "1.0.0", optional = true }
8484

8585
# localtime support for render-tui

src/progress/key.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ pub(crate) type Id = u16;
1515
pub struct Key(Option<Id>, Option<Id>, Option<Id>, Option<Id>, Option<Id>, Option<Id>);
1616

1717
/// Determines if a sibling is above or below in the given level of hierarchy
18-
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]
18+
#[derive(Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]
1919
#[allow(missing_docs)]
2020
pub enum SiblingLocation {
2121
Above,
2222
Below,
2323
AboveAndBelow,
24+
#[default]
2425
NotFound,
2526
}
2627

@@ -40,12 +41,6 @@ impl SiblingLocation {
4041
}
4142
}
4243

43-
impl Default for SiblingLocation {
44-
fn default() -> Self {
45-
SiblingLocation::NotFound
46-
}
47-
}
48-
4944
/// A type providing information about what's above and below `Tree` items.
5045
#[derive(Copy, Clone, Default, Eq, PartialEq, Ord, PartialOrd, Debug)]
5146
pub struct Adjacency(

src/progress/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub type Step = usize;
4141
pub type StepShared = Arc<AtomicUsize>;
4242

4343
/// Indicate whether a progress can or cannot be made.
44-
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
44+
#[derive(Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
4545
pub enum State {
4646
/// Indicates a task is blocked and cannot indicate progress, optionally until the
4747
/// given time. The task cannot easily be interrupted.
@@ -50,15 +50,10 @@ pub enum State {
5050
/// given time. The task can be interrupted.
5151
Halted(&'static str, Option<SystemTime>),
5252
/// The task is running
53+
#[default]
5354
Running,
5455
}
5556

56-
impl Default for State {
57-
fn default() -> Self {
58-
State::Running
59-
}
60-
}
61-
6257
/// Progress associated with some item in the progress tree.
6358
#[derive(Clone, Default, Debug)]
6459
pub struct Value {

src/render/line/draw.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,7 @@ fn block_count_sans_ansi_codes(strings: &[ANSIString<'_>]) -> u16 {
230230
strings.iter().map(|s| s.width() as u16).sum()
231231
}
232232

233-
fn draw_progress_bar<'a>(
234-
p: &Value,
235-
style: Style,
236-
mut blocks_available: u16,
237-
colored: bool,
238-
buf: &mut Vec<ANSIString<'a>>,
239-
) {
233+
fn draw_progress_bar(p: &Value, style: Style, mut blocks_available: u16, colored: bool, buf: &mut Vec<ANSIString<'_>>) {
240234
let mut brush = color::Brush::new(colored);
241235
let styled_brush = brush.style(style);
242236

0 commit comments

Comments
 (0)