Skip to content

Commit

Permalink
Merge branch 'column_render'
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Dec 8, 2023
2 parents 917339f + 645474c commit bf4da4e
Show file tree
Hide file tree
Showing 8 changed files with 226 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: fmt
run: cargo fmt --all -- --check
- name: clippy
run: cargo clippy
run: cargo clippy -- -D warnings
- name: Check crate package size (feat. 'cargo diet')
continue-on-error: true
run: |
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "dua-cli"
version = "2.21.0"
authors = ["Sebastian Thiel <[email protected]>"]
edition = "2018"
edition = "2021"
repository = "https:/Byron/dua-cli"
readme = "README.md"
description = "A tool to conveniently learn about the disk usage of directories, fast!"
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ target/debug/dua: always
target/release/dua: always
cargo build --release

lint: ## Run lints with clippy
cargo clippy
clippy: ## Run lints with clippy
cargo clippy -- -D warnings

profile: target/release/dua ## run callgrind and annotate its output - linux only
valgrind --callgrind-out-file=callgrind.profile --tool=callgrind $< >/dev/null
Expand Down
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub struct ByteFormatDisplay {
}

impl fmt::Display for ByteFormatDisplay {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
use byte_unit::Byte;
use ByteFormat::*;

Expand Down
8 changes: 4 additions & 4 deletions src/interactive/app/eventloop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl TerminalApp {
Some(s) => {
s.entries = sorted_entries(&traversal.tree, s.root, s.sorting);
if !received_events {
s.selected = s.entries.get(0).map(|b| b.index);
s.selected = s.entries.first().map(|b| b.index);
}
s
}
Expand All @@ -269,7 +269,7 @@ impl TerminalApp {
AppState {
root: traversal.root_index,
sorting,
selected: entries.get(0).map(|b| b.index),
selected: entries.first().map(|b| b.index),
entries,
is_scanning: true,
..Default::default()
Expand Down Expand Up @@ -316,9 +316,9 @@ impl TerminalApp {
s.is_scanning = false;
s.entries = sorted_entries(&traversal.tree, s.root, s.sorting);
s.selected = if received_events {
s.selected.or_else(|| s.entries.get(0).map(|b| b.index))
s.selected.or_else(|| s.entries.first().map(|b| b.index))
} else {
s.entries.get(0).map(|b| b.index)
s.entries.first().map(|b| b.index)
};
s
},
Expand Down
4 changes: 2 additions & 2 deletions src/interactive/app/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl AppState {
.bookmarks
.get(&parent_idx)
.copied()
.or_else(|| self.entries.get(0).map(|b| b.index));
.or_else(|| self.entries.first().map(|b| b.index));
}
None => self.message = Some("Top level reached".into()),
}
Expand Down Expand Up @@ -321,7 +321,7 @@ impl AppState {
.and_then(|selected| self.entries.iter().find(|e| e.index == selected))
.is_none()
{
self.selected = self.entries.get(0).map(|e| e.index);
self.selected = self.entries.first().map(|e| e.index);
}
self.recompute_sizes_recursively(parent_idx, traversal);
entries_deleted
Expand Down
Loading

0 comments on commit bf4da4e

Please sign in to comment.