build: bump MSRV to 1.65.0 (#171)

The latest version of the time crate requires Rust 1.65.0

```
cargo +1.64.0-x86_64-apple-darwin test --no-default-features \
  --features serde,crossterm,all-widgets --lib --tests --examples
error: package `time v0.3.21` cannot be built because it requires rustc
1.65.0 or newer, while the currently active rustc version is 1.64.0
```

Also fixes several clippy warnings added in 1.63/1.65. Although these
have been since moved to nursery / pedantic, it doesn't hurt to fix
these issues as part of this change:

- https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq (nursery)
- https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if (pedantic)
This commit is contained in:
Josh McKinney 2023-05-12 08:45:00 -07:00 committed by GitHub
parent 2f0d549a50
commit 1cc405d2dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 18 deletions

View file

@ -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

View file

@ -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]

View file

@ -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

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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,