Skip to content

Commit f5bd095

Browse files
committed
bug: change as_ref calls so rust beta 1.61 builds
For context, see: - #708 - rust-lang/rust#96074 This changes the calls from `as_ref()`, which was causing type inference issues, to just `as_slice()` which works fine.
1 parent 0518166 commit f5bd095

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [0.6.9] / [0.7.0] - Unreleased
99

10+
## Bug Fixes
11+
12+
- [#711](https://github.com/ClementTsang/bottom/pull/711): Fix building in Rust beta 1.61 due to `as_ref()` calls
13+
causing type inference issues.
14+
15+
## Changes
16+
17+
- [#609](https://github.com/ClementTsang/bottom/pull/690): Adds some colour to `-h`/`--help` as part of updating to clap 3.0.
18+
1019
## Features
1120

1221
- [#676](https://github.com/ClementTsang/bottom/pull/676): Adds support for NVIDIA GPU temperature sensors.

src/canvas.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ impl Painter {
627627
if self.derived_widget_draw_locs.is_empty() || app_state.is_force_redraw {
628628
let draw_locs = Layout::default()
629629
.margin(0)
630-
.constraints(self.row_constraints.as_ref())
630+
.constraints(self.row_constraints.as_slice())
631631
.direction(Direction::Vertical)
632632
.split(terminal_size);
633633

@@ -648,7 +648,7 @@ impl Painter {
648648
)| {
649649
izip!(
650650
Layout::default()
651-
.constraints(col_constraint.as_ref())
651+
.constraints(col_constraint.as_slice())
652652
.direction(Direction::Horizontal)
653653
.split(draw_loc)
654654
.into_iter(),
@@ -659,7 +659,7 @@ impl Painter {
659659
.map(|(split_loc, constraint, col_constraint_vec, col_rows)| {
660660
izip!(
661661
Layout::default()
662-
.constraints(constraint.as_ref())
662+
.constraints(constraint.as_slice())
663663
.direction(Direction::Vertical)
664664
.split(split_loc)
665665
.into_iter(),
@@ -669,7 +669,7 @@ impl Painter {
669669
.map(|(draw_loc, col_row_constraint_vec, widgets)| {
670670
// Note that col_row_constraint_vec CONTAINS the widget constraints
671671
let widget_draw_locs = Layout::default()
672-
.constraints(col_row_constraint_vec.as_ref())
672+
.constraints(col_row_constraint_vec.as_slice())
673673
.direction(Direction::Horizontal)
674674
.split(draw_loc);
675675

src/canvas/dialogs/dd_dialog.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,11 @@ impl KillDialog for Painter {
376376
// Now draw buttons if needed...
377377
let split_draw_loc = Layout::default()
378378
.direction(Direction::Vertical)
379-
.constraints(
380-
if app_state.dd_err.is_some() {
381-
vec![Constraint::Percentage(100)]
382-
} else {
383-
vec![Constraint::Min(3), Constraint::Length(btn_height)]
384-
}
385-
.as_ref(),
386-
)
379+
.constraints(if app_state.dd_err.is_some() {
380+
vec![Constraint::Percentage(100)]
381+
} else {
382+
vec![Constraint::Min(3), Constraint::Length(btn_height)]
383+
})
387384
.split(draw_loc);
388385

389386
// This being true implies that dd_err is none.

0 commit comments

Comments
 (0)