diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfa363e9..91c53c9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - rust: ["1.59.0", "stable"] + rust: ["1.65.0", "stable"] include: - os: ubuntu-latest triple: x86_64-unknown-linux-musl diff --git a/Cargo.toml b/Cargo.toml index d5913da7..d5892689 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ license = "MIT" exclude = ["assets/*", ".github", "Makefile.toml", "CONTRIBUTING.md", "*.log", "tags"] autoexamples = true edition = "2021" -rust-version = "1.59.0" +rust-version = "1.65.0" [badges] diff --git a/README.md b/README.md index 0a719d3f..25987c95 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ you may rely on the previously cited libraries to achieve such features. ## Rust version requirements -Since version 0.17.0, `ratatui` requires **rustc version 1.59.0 or greater**. +Since version 0.21.0, `ratatui` requires **rustc version 1.65.0 or greater**. # Documentation diff --git a/src/backend/mod.rs b/src/backend/mod.rs index 2c9e2a0a..75165869 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -16,7 +16,7 @@ pub use self::crossterm::CrosstermBackend; mod test; pub use self::test::TestBackend; -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum ClearType { All, AfterCursor, diff --git a/src/terminal.rs b/src/terminal.rs index 1441812c..37aab480 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -6,14 +6,14 @@ use crate::{ }; use std::io; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum Viewport { Fullscreen, Inline(u16), Fixed(Rect), } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] /// Options to pass to [`Terminal::with_options`] pub struct TerminalOptions { /// Viewport used to draw to the terminal diff --git a/src/widgets/block.rs b/src/widgets/block.rs index e751b696..d63838cf 100644 --- a/src/widgets/block.rs +++ b/src/widgets/block.rs @@ -313,17 +313,8 @@ impl<'a> Widget for Block<'a> { // Title if let Some(title) = self.title { - let left_border_dx = if self.borders.intersects(Borders::LEFT) { - 1 - } else { - 0 - }; - - let right_border_dx = if self.borders.intersects(Borders::RIGHT) { - 1 - } else { - 0 - }; + let left_border_dx = self.borders.intersects(Borders::LEFT) as u16; + let right_border_dx = self.borders.intersects(Borders::RIGHT) as u16; let title_area_width = area .width diff --git a/src/widgets/chart.rs b/src/widgets/chart.rs index c9d32645..a8642b3a 100644 --- a/src/widgets/chart.rs +++ b/src/widgets/chart.rs @@ -366,7 +366,7 @@ impl<'a> Chart<'a> { let width_left_of_y_axis = match self.x_axis.labels_alignment { Alignment::Left => { // The last character of the label should be below the Y-Axis when it exists, not on its left - let y_axis_offset = if has_y_axis { 1 } else { 0 }; + let y_axis_offset = has_y_axis as u16; first_label_width.saturating_sub(y_axis_offset) } Alignment::Center => first_label_width / 2,