Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .git-hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ else
fi

echo "👷 Checking CLI code with Clippy ..."
cargo clippy --all-features
cargo clippy --all-features -- --deny warnings
CLIPPY_EXIT_CODE=$?
if [ $CLIPPY_EXIT_CODE -ne 0 ]; then
echo "❌ Please fix the issues Clippy raised in CLI code."
Expand All @@ -79,7 +79,7 @@ else
fi

echo "👷 Checking BuildIt code with Clippy ..."
cargo clippy --manifest-path ./buildit/Cargo.toml --all-features
cargo clippy --manifest-path ./buildit/Cargo.toml --all-features -- --deny warnings
CLIPPY_EXIT_CODE=$?
if [ $CLIPPY_EXIT_CODE -ne 0 ]; then
echo "❌ Please fix the issues Clippy raised in BuildIt code."
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
run: cargo fmt --manifest-path ./buildit/Cargo.toml -- --check

- name: Lint with Clippy
run: cargo clippy --no-deps --all-features
run: cargo clippy --no-deps --all-features -- --deny warnings

- name: Check code formatting (BuildIt)
run: cargo fmt -- --check

- name: Lint with Clippy (BuildIt)
run: cargo clippy --manifest-path ./buildit/Cargo.toml --all-features
run: cargo clippy --manifest-path ./buildit/Cargo.toml --all-features -- --deny warnings
8 changes: 4 additions & 4 deletions benches/arenas_alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn benchmark_std_alloc(
});

items.push(parent);
})
});
});

if sample_number == sample_size {
Expand Down Expand Up @@ -150,7 +150,7 @@ fn benchmark_bumpalo(

parent.children.push(child);
item_count += 1;
})
});
});

if sample_number == sample_size {
Expand Down Expand Up @@ -203,7 +203,7 @@ fn benchmark_id_arena(
});

arena.get_mut(parent).unwrap().children.push(child);
})
});
});

if sample_number == sample_size {
Expand Down Expand Up @@ -266,7 +266,7 @@ fn benchmark_rapid_arena(
});

parent.deref_mut().children.push(child);
})
});
});

if sample_number == sample_size {
Expand Down
2 changes: 1 addition & 1 deletion benches/directory_item_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn directory_item_build(c: &mut Criterion) {
|b| {
b.iter(|| {
black_box(DirectoryItem::build(vec![path.clone()], &should_exit));
})
});
},
);
}
Expand Down
2 changes: 1 addition & 1 deletion benches/directory_item_build_x2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn directory_item_build_x2(c: &mut Criterion) {
|b| {
b.iter(|| {
black_box(DirectoryItem::build(vec![path.clone()], &should_exit));
})
});
},
);
}
Expand Down
24 changes: 12 additions & 12 deletions src/cli/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,34 +172,34 @@ fn render_loop<B: Backend, I: InputEventSource>(
} else {
match code {
KeyCode::Char(VIEW_SIZE_THRESHOLD_0_PERCENT_KEY) => {
view_state.set_size_threshold_fraction(0f32)
view_state.set_size_threshold_fraction(0f32);
}
KeyCode::Char(VIEW_SIZE_THRESHOLD_10_PERCENT_KEY) => {
view_state.set_size_threshold_fraction(0.01f32)
view_state.set_size_threshold_fraction(0.01f32);
}
KeyCode::Char(VIEW_SIZE_THRESHOLD_20_PERCENT_KEY) => {
view_state.set_size_threshold_fraction(0.02f32)
view_state.set_size_threshold_fraction(0.02f32);
}
KeyCode::Char(VIEW_SIZE_THRESHOLD_30_PERCENT_KEY) => {
view_state.set_size_threshold_fraction(0.03f32)
view_state.set_size_threshold_fraction(0.03f32);
}
KeyCode::Char(VIEW_SIZE_THRESHOLD_40_PERCENT_KEY) => {
view_state.set_size_threshold_fraction(0.04f32)
view_state.set_size_threshold_fraction(0.04f32);
}
KeyCode::Char(VIEW_SIZE_THRESHOLD_50_PERCENT_KEY) => {
view_state.set_size_threshold_fraction(0.05f32)
view_state.set_size_threshold_fraction(0.05f32);
}
KeyCode::Char(VIEW_SIZE_THRESHOLD_60_PERCENT_KEY) => {
view_state.set_size_threshold_fraction(0.06f32)
view_state.set_size_threshold_fraction(0.06f32);
}
KeyCode::Char(VIEW_SIZE_THRESHOLD_70_PERCENT_KEY) => {
view_state.set_size_threshold_fraction(0.07f32)
view_state.set_size_threshold_fraction(0.07f32);
}
KeyCode::Char(VIEW_SIZE_THRESHOLD_80_PERCENT_KEY) => {
view_state.set_size_threshold_fraction(0.08f32)
view_state.set_size_threshold_fraction(0.08f32);
}
KeyCode::Char(VIEW_SIZE_THRESHOLD_90_PERCENT_KEY) => {
view_state.set_size_threshold_fraction(0.09f32)
view_state.set_size_threshold_fraction(0.09f32);
}
KeyCode::Char(HELP_KEY) => view_state.show_help = true,
KeyCode::Char(DELETE_KEY) => view_state.show_delete_dialog = true,
Expand All @@ -214,11 +214,11 @@ fn render_loop<B: Backend, I: InputEventSource>(
KeyCode::End => view_state.last(),
KeyCode::Char(COLLAPSE_SELECTED_CHILDREN_KEY)
| KeyCode::Char(COLLAPSE_SELECTED_CHILDREN_KEY_ALT) => {
view_state.collapse_selected_children()
view_state.collapse_selected_children();
}
KeyCode::Char(EXPAND_SELECTED_CHILDREN_KEY)
| KeyCode::Char(EXPAND_SELECTED_CHILDREN_KEY_ALT) => {
view_state.expand_selected_children()
view_state.expand_selected_children();
}
_ => {}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cli/view_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ impl ViewState {
for item in &self.item_tree {
count += get_item_tree_count(item);
}
self.total_items_in_tree = count
self.total_items_in_tree = count;
}

pub(crate) fn accept_license_terms(&mut self) {
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
#![deny(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]

//! Space may be the final frontier, but it sure is annoying when you run out. 🖖
//!
Expand Down
2 changes: 1 addition & 1 deletion src/rapid_arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl<T> RapIdArena<T> {
for item in bucket {
data.push(RapId {
p: ptr::NonNull::from(item),
})
});
}
}
RapIdArenaIterator::<T> { data, index: 0 }
Expand Down
4 changes: 2 additions & 2 deletions src/rapid_arena_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ fn deref_multi_threaded_test() {
#[allow(clippy::unit_arg)]
black_box({
let _ = item.some_value + 1;
})
});
}
});
}
Expand Down Expand Up @@ -296,7 +296,7 @@ fn deref_mut_multi_threaded_test() {
thread::sleep(Duration::from_millis(1));

assert_eq!(some_value, item.some_value);
assert_eq!(some_string, item.some_string)
assert_eq!(some_string, item.some_string);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/space_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl BenchmarkCommand {
.unwrap()
.run(self)
.unwrap();
})
});
});
Ok(())
}
Expand Down