Skip to content

Commit d0cc607

Browse files
authored
deps: Update dependencies, drop MSRV
Update dependencies to most recent versions if applicable. Refactor to deal with breaking changes. Drop MSRV due to dependency issues, just support stable and later.
1 parent 17552c5 commit d0cc607

22 files changed

+404
-372
lines changed

.travis.yml

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
language: rust
22
rust:
3-
# MSRV; though I only want to test if it builds.
4-
- 1.40.0
53
- stable
64
- beta
75
os:
@@ -13,8 +11,6 @@ jobs:
1311
exclude:
1412
- if: tag IS present
1513
rust: beta
16-
- if: tag IS present
17-
rust: 1.40.0
1814
branches:
1915
only:
2016
- master
@@ -34,15 +30,9 @@ before_script:
3430
- rustup target add $TARGET
3531
- rustup component add clippy
3632
script:
37-
- |
38-
if [[ $TRAVIS_RUST_VERSION != "1.40.0" ]]; then
39-
cargo clippy -- -D clippy::all
40-
fi
33+
- cargo clippy -- -D clippy::all
4134
- cargo build --verbose --target $TARGET
42-
- |
43-
if [[ $TRAVIS_RUST_VERSION != "1.40.0" ]]; then
44-
cargo test --verbose --target $TARGET;
45-
fi
35+
- cargo test --verbose --target $TARGET
4636
- cargo install --path . --target $TARGET --locked --force
4737

4838
before_cache:

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
- [179](https://github.com/ClementTsang/bottom/pull/179): Show full command/process path as an option.
1515

16+
### Changes
17+
18+
- Changed to just support stable (and newer) Rust, due to library incompatibilities.
19+
1620
## [0.4.5] - 2020-07-08
1721

1822
- No changes here, just an uptick for Crates.io using the wrong Cargo.lock.

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ For reports/suggestions that don't fit the definition of a feature or bug, try t
3636
If you want to help contribute by submitting a PR, by all means, I'm open! In regards to the development process:
3737

3838
- I develop primarily using _stable_ Rust. That is, whatever is the most up-to-date stable version you can get via running
39-
`rustup update stable`. However, as of writing, I do support a MSRV of 1.40.0.
39+
`rustup update stable`.
4040

4141
- Note that `cargo test` will fail on anything lower than 1.43.0 due to it using a then-introduced env variable.
4242

Cargo.lock

+21-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+7-6
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ codegen-units = 1
2323
[dependencies]
2424
battery = "0.7.5"
2525
crossterm = "0.17"
26-
chrono = "0.4.11"
27-
clap = "2.33.1"
28-
dirs = "2.0.2"
26+
chrono = "0.4.13"
27+
clap = "2.33.2"
28+
dirs = "3.0.1"
2929
futures = "0.3.5"
3030
heim = "0.0.10"
3131
itertools = "0.9.0"
3232
regex = "1.3"
33-
sysinfo = "0.14.2"
33+
sysinfo = "0.15.0"
3434
toml = "0.5.6"
35-
typed-builder = "0.6.0"
35+
typed-builder = "0.7.0"
3636
lazy_static = "1.4.0"
3737
backtrace = "0.3"
3838
serde = {version = "1.0", features = ["derive"] }
3939
unicode-segmentation = "1.6.0"
4040
unicode-width = "0.1.7"
41-
tui = {version = "0.9", features = ["crossterm"], default-features = false }
41+
tui = {version = "0.10.0", features = ["crossterm"], default-features = false }
4242

4343
# For debugging only...
4444
fern = "0.6.0"
@@ -50,6 +50,7 @@ winapi = "0.3.8"
5050
[dev-dependencies]
5151
assert_cmd = "1.0"
5252
predicates = "1"
53+
cargo-husky = "1"
5354

5455
[package.metadata.deb]
5556
section = "utils"

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A cross-platform graphical process/system monitor with a customizable interface
1313
## Table of Contents
1414

1515
- [Installation](#installation)
16-
- [Manual](#manual)
16+
- [Manually](#manually)
1717
- [Cargo](#cargo)
1818
- [AUR](#aur)
1919
- [Debian (and Debian-based)](#debian)
@@ -59,9 +59,9 @@ Note that bottom is:
5959

6060
As such, support beyond that is not guaranteed.
6161

62-
### Manual
62+
### [Manually]
6363

64-
There are a few ways to go about doing this. Note that the MSRV is 1.40.0. For example:
64+
There are a few ways to go about doing this manually. If you do so, please build using the current stable release of Rust. For example:
6565

6666
```bash
6767
# If required, update Rust on the stable channel
@@ -84,6 +84,9 @@ cargo install --path .
8484
### Cargo
8585

8686
```bash
87+
# If required, update Rust on the stable channel
88+
rustup update stable
89+
8790
cargo install bottom
8891

8992
# OR, --locked may be required due to how cargo install works

src/canvas.rs

+14-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::collections::HashMap;
44
use tui::{
55
backend::Backend,
66
layout::{Constraint, Direction, Layout, Rect},
7-
widgets::Text,
7+
text::{Span, Spans},
88
Frame, Terminal,
99
};
1010

@@ -55,7 +55,7 @@ pub struct Painter {
5555
pub colours: CanvasColours,
5656
height: u16,
5757
width: u16,
58-
styled_help_text: Vec<Text<'static>>,
58+
styled_help_text: Vec<Spans<'static>>,
5959
is_mac_os: bool,
6060
row_constraints: Vec<Constraint>,
6161
col_constraints: Vec<Vec<Constraint>>,
@@ -139,14 +139,14 @@ impl Painter {
139139
colours: CanvasColours::default(),
140140
height: 0,
141141
width: 0,
142-
styled_help_text: Vec::new(),
142+
styled_help_text: Vec::default(),
143143
is_mac_os: false,
144144
row_constraints,
145145
col_constraints,
146146
col_row_constraints,
147147
layout_constraints,
148148
widget_layout,
149-
derived_widget_draw_locs: Vec::new(),
149+
derived_widget_draw_locs: Vec::default(),
150150
table_height_offset: 4 + table_gap,
151151
}
152152
}
@@ -155,34 +155,35 @@ impl Painter {
155155
/// This is to set some remaining styles and text.
156156
pub fn complete_painter_init(&mut self) {
157157
self.is_mac_os = cfg!(target_os = "macos");
158+
let mut styled_help_spans = Vec::new();
158159

159160
// Init help text:
160161
(*HELP_TEXT).iter().enumerate().for_each(|(itx, section)| {
161162
if itx == 0 {
162-
self.styled_help_text.extend(
163+
styled_help_spans.extend(
163164
section
164165
.iter()
165-
.map(|&text| Text::Styled(text.into(), self.colours.text_style))
166+
.map(|&text| Span::styled(text, self.colours.text_style))
166167
.collect::<Vec<_>>(),
167168
);
168169
} else {
169170
// Not required check but it runs only a few times... so whatever ig, prevents me from
170171
// being dumb and leaving a help text section only one line long.
171172
if section.len() > 1 {
172-
self.styled_help_text.push(Text::Raw("\n\n".into()));
173-
self.styled_help_text.push(Text::Styled(
174-
section[0].into(),
175-
self.colours.table_header_style,
176-
));
177-
self.styled_help_text.extend(
173+
styled_help_spans.push(Span::from("\n\n"));
174+
styled_help_spans
175+
.push(Span::styled(section[0], self.colours.table_header_style));
176+
styled_help_spans.extend(
178177
section[1..]
179178
.iter()
180-
.map(|&text| Text::Styled(text.into(), self.colours.text_style))
179+
.map(|&text| Span::styled(text, self.colours.text_style))
181180
.collect::<Vec<_>>(),
182181
);
183182
}
184183
}
185184
});
185+
186+
self.styled_help_text = styled_help_spans.into_iter().map(Spans::from).collect();
186187
}
187188

188189
pub fn draw_data<B: Backend>(

src/canvas/canvas_colours.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl CanvasColours {
8585
}
8686

8787
pub fn set_table_header_colour(&mut self, colour: &str) -> error::Result<()> {
88-
self.table_header_style = get_style_from_config(colour)?.modifier(Modifier::BOLD);
88+
self.table_header_style = get_style_from_config(colour)?.add_modifier(Modifier::BOLD);
8989
Ok(())
9090
}
9191

0 commit comments

Comments
 (0)