Skip to content

Commit

Permalink
build: bump MSRV to 1.65.0 (#171)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
joshka authored May 12, 2023
1 parent 2f0d549 commit 1cc405d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 2 additions & 11 deletions src/widgets/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/chart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1cc405d

Please sign in to comment.