Skip to content

Commit 9f1e546

Browse files
fix: Resolve clippy and rustdoc warnings
- Use contains_key instead of get().is_none() - Simplify int comparison (total_len < max_len) - Allow clippy::too_many_arguments for build_job_item - Allow clippy::needless_range_loop for chain position marking - Escape brackets in doc comment to fix rustdoc link warning 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1e08b40 commit 9f1e546

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

crates/charmer-monitor/src/components/job_list.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn compute_dependencies(
8787
return relations;
8888
}
8989

90-
if state.jobs.get(selected_id).is_none() {
90+
if !state.jobs.contains_key(selected_id) {
9191
return relations;
9292
}
9393

@@ -188,6 +188,7 @@ fn compute_dependencies(
188188
let max_idx = chain_indices[chain_indices.len() - 1];
189189

190190
// Mark positions for all rows in the range
191+
#[allow(clippy::needless_range_loop)]
191192
for idx in min_idx..=max_idx {
192193
if relations[idx].0 != DepRelation::None {
193194
// This is an actual chain member
@@ -324,6 +325,7 @@ impl JobList {
324325
}
325326

326327
/// Build a single job list item with responsive columns.
328+
#[allow(clippy::too_many_arguments)]
327329
fn build_job_item(
328330
row_num: usize,
329331
list_index: usize,
@@ -438,7 +440,7 @@ fn build_job_item(
438440
for (i, value) in wildcards.iter().enumerate() {
439441
if i > 0 {
440442
// Add pipe separator
441-
if total_len + 1 <= max_len {
443+
if total_len < max_len {
442444
wildcard_spans.push(Span::styled("|", sep_style));
443445
total_len += 1;
444446
} else {

crates/charmer-monitor/src/components/view_tabs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct ViewTabs;
1010

1111
impl ViewTabs {
1212
/// Generate a title Line with inline tab selection.
13-
/// Returns something like: " [Jobs] Rules "
13+
/// Returns something like: " \[Jobs\] Rules "
1414
pub fn title_line(view_mode: ViewMode) -> Line<'static> {
1515
let tabs = [("Jobs", ViewMode::Jobs), ("Rules", ViewMode::Rules)];
1616

0 commit comments

Comments
 (0)