Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: change as_ref() calls as needed to build in Rust beta 1.61.0 #711

Merged
merged 2 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,26 @@ jobs:
rust: stable,
}

# Beta; should be allowed to fail.
- {
os: "ubuntu-latest",
target: "x86_64-unknown-linux-gnu",
cross: false,
rust: beta,
}
- {
os: "macOS-latest",
target: "x86_64-apple-darwin",
cross: false,
rust: beta,
}
- {
os: "windows-2019",
target: "x86_64-pc-windows-msvc",
cross: false,
rust: beta,
}

# aarch64
- {
os: "ubuntu-latest",
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.6.9] / [0.7.0] - Unreleased

## Bug Fixes

- [#711](https://github.com/ClementTsang/bottom/pull/711): Fix building in Rust beta 1.61 due to `as_ref()` calls
causing type inference issues.

## Changes

- [#690](https://github.com/ClementTsang/bottom/pull/690): Adds some colour to `-h`/`--help` as part of updating to clap 3.0.

## Features

- [#676](https://github.com/ClementTsang/bottom/pull/676): Adds support for NVIDIA GPU temperature sensors.
Expand Down
8 changes: 4 additions & 4 deletions src/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ impl Painter {
if self.derived_widget_draw_locs.is_empty() || app_state.is_force_redraw {
let draw_locs = Layout::default()
.margin(0)
.constraints(self.row_constraints.as_ref())
.constraints(self.row_constraints.as_slice())
.direction(Direction::Vertical)
.split(terminal_size);

Expand All @@ -648,7 +648,7 @@ impl Painter {
)| {
izip!(
Layout::default()
.constraints(col_constraint.as_ref())
.constraints(col_constraint.as_slice())
.direction(Direction::Horizontal)
.split(draw_loc)
.into_iter(),
Expand All @@ -659,7 +659,7 @@ impl Painter {
.map(|(split_loc, constraint, col_constraint_vec, col_rows)| {
izip!(
Layout::default()
.constraints(constraint.as_ref())
.constraints(constraint.as_slice())
.direction(Direction::Vertical)
.split(split_loc)
.into_iter(),
Expand All @@ -669,7 +669,7 @@ impl Painter {
.map(|(draw_loc, col_row_constraint_vec, widgets)| {
// Note that col_row_constraint_vec CONTAINS the widget constraints
let widget_draw_locs = Layout::default()
.constraints(col_row_constraint_vec.as_ref())
.constraints(col_row_constraint_vec.as_slice())
.direction(Direction::Horizontal)
.split(draw_loc);

Expand Down
13 changes: 5 additions & 8 deletions src/canvas/dialogs/dd_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,11 @@ impl KillDialog for Painter {
// Now draw buttons if needed...
let split_draw_loc = Layout::default()
.direction(Direction::Vertical)
.constraints(
if app_state.dd_err.is_some() {
vec![Constraint::Percentage(100)]
} else {
vec![Constraint::Min(3), Constraint::Length(btn_height)]
}
.as_ref(),
)
.constraints(if app_state.dd_err.is_some() {
vec![Constraint::Percentage(100)]
} else {
vec![Constraint::Min(3), Constraint::Length(btn_height)]
})
.split(draw_loc);

// This being true implies that dd_err is none.
Expand Down