Formatting and typos (#63)

* Fix typo and run rustfmt.

* Also add rustfmt check to travis... this might be temporary.

* Add a bit on default config files being created in the debian extended description.

* Add rustup component add to travis.

* Disable rustfmt for now, seems to play weird on windows builds.

* Remove unneccesary deprecate ignore.
This commit is contained in:
Clement Tsang 2020-03-05 02:09:29 -05:00 committed by GitHub
parent d018c6ee88
commit 188858fedd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 15 deletions

View File

@ -25,8 +25,10 @@ before_install:
before_script: before_script:
- rustup target add $TARGET - rustup target add $TARGET
- rustup component add clippy - rustup component add clippy
#- rustup component add rustfmt
script: script:
- cargo clippy -- -D clippy::all - cargo clippy -- -D clippy::all
#- cargo fmt -- --check
- cargo build --verbose --target $TARGET - cargo build --verbose --target $TARGET
- cargo test --verbose --target $TARGET - cargo test --verbose --target $TARGET

View File

@ -55,5 +55,6 @@ assets = [
] ]
extended-description = """\ extended-description = """\
By default, bottom will look for a config file in ~/.config/bottom/bottom.toml. By default, bottom will look for a config file in ~/.config/bottom/bottom.toml.
If one is not specified it will fall back to defaults. If one is not specified it will fall back to defaults. If a config file does not
exist at the specified or default location, a blank one will be created for the user.
""" """

View File

@ -134,7 +134,7 @@ Run using `btm`.
- `-s`, `--show_disabled_data` will show data entries in the graph legends even if the lines for that entry are disabled. - `-s`, `--show_disabled_data` will show data entries in the graph legends even if the lines for that entry are disabled.
- `-C`, `--config` takes in a file path leading to a TOML file. If doesn't exist, creates one. - `-C`, `--config` takes in a file path leading to a TOML file. If the file doesn't exist, one will be created.
- `-b`, `--basic` will enable basic mode, removing all graphs from the main interface and condensing data. - `-b`, `--basic` will enable basic mode, removing all graphs from the main interface and condensing data.

View File

@ -375,7 +375,7 @@ impl Painter {
.constraints([Constraint::Percentage(100)].as_ref()) .constraints([Constraint::Percentage(100)].as_ref())
.split(f.size()); .split(f.size());
match &app_state.current_widget_selected { match &app_state.current_widget_selected {
WidgetPosition::Cpu | WidgetPosition::BasicCpu => { WidgetPosition::Cpu | WidgetPosition::BasicCpu => {
let cpu_chunk = Layout::default() let cpu_chunk = Layout::default()
.direction(Direction::Horizontal) .direction(Direction::Horizontal)
.margin(0) .margin(0)
@ -385,7 +385,7 @@ impl Painter {
} else { } else {
[Constraint::Percentage(85), Constraint::Percentage(15)] [Constraint::Percentage(85), Constraint::Percentage(15)]
} }
.as_ref(), .as_ref(),
) )
.split(rect[0]); .split(rect[0]);
@ -424,7 +424,7 @@ impl Painter {
// the same info. // the same info.
let cpu_height = (app_state.canvas_data.cpu_data.len() / 4) as u16 let cpu_height = (app_state.canvas_data.cpu_data.len() / 4) as u16
+ ( + (
if app_state.canvas_data.cpu_data.len() % 4 == 0 { if app_state.canvas_data.cpu_data.len() % 4 == 0 {
0 0
} else { } else {
@ -442,13 +442,13 @@ impl Painter {
].as_ref()) ].as_ref())
.split(f.size()); .split(f.size());
let middle_chunks= Layout::default() let middle_chunks = Layout::default()
.direction(Direction::Horizontal) .direction(Direction::Horizontal)
.constraints([ .constraints([
Constraint::Percentage(50), Constraint::Percentage(50),
Constraint::Percentage(50), Constraint::Percentage(50),
].as_ref()) ].as_ref())
.split(vertical_chunks[2]); .split(vertical_chunks[2]);
self.draw_basic_cpu(&mut f, app_state, vertical_chunks[0]); self.draw_basic_cpu(&mut f, app_state, vertical_chunks[0]);
self.draw_basic_memory(&mut f, app_state, middle_chunks[0]); self.draw_basic_memory(&mut f, app_state, middle_chunks[0]);
self.draw_basic_network(&mut f, app_state, middle_chunks[1]); self.draw_basic_network(&mut f, app_state, middle_chunks[1]);
@ -469,7 +469,7 @@ impl Painter {
Constraint::Percentage(37), Constraint::Percentage(37),
Constraint::Percentage(33), Constraint::Percentage(33),
] ]
.as_ref(), .as_ref(),
) )
.split(f.size()); .split(f.size());
@ -501,7 +501,7 @@ impl Painter {
} else { } else {
[Constraint::Percentage(85), Constraint::Percentage(15)] [Constraint::Percentage(85), Constraint::Percentage(15)]
} }
.as_ref(), .as_ref(),
) )
.split(vertical_chunks[0]); .split(vertical_chunks[0]);

View File

@ -99,7 +99,6 @@ fn get_matches() -> clap::ArgMatches<'static> {
.get_matches() .get_matches()
} }
#[allow(deprecated)]
fn main() -> error::Result<()> { fn main() -> error::Result<()> {
create_logger()?; create_logger()?;
let matches = get_matches(); let matches = get_matches();