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:
- rustup target add $TARGET
- rustup component add clippy
#- rustup component add rustfmt
script:
- cargo clippy -- -D clippy::all
#- cargo fmt -- --check
- cargo build --verbose --target $TARGET
- cargo test --verbose --target $TARGET

View file

@ -55,5 +55,6 @@ assets = [
]
extended-description = """\
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.
- `-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.

View file

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

View file

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