Skip to content

Commit e52ecfc

Browse files
committed
fix: resolve clippy lints for nightly-2026-04-24 and matrix-sdk compat
Fix all new clippy lints introduced by the nightly bump: - collapsible_match: collapse inner `if` into match arm guards - unnecessary_sort_by: use sort_by_key with Reverse for desc sorts - question_mark: use `?` operator for early returns - useless_conversion: remove redundant .into_iter() - unnecessary cast: remove u32 -> u32 casts - explicit_counter_loop: use enumerate() instead of manual counter Also work around matrix-sdk 0.16 query-depth overflow on nightly >= 2025-12-28 by removing `matrix` from default features and making the metrics feature forward conditional (`moltis-matrix?/metrics`). Matrix support is still available via `--features matrix`.
1 parent 8a4d058 commit e52ecfc

23 files changed

Lines changed: 144 additions & 113 deletions

File tree

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
### Security
2121

22+
## [20260426.01] - 2026-04-26
23+
### Added
24+
- [cron] Add heartbeat wake cooldown to prevent exec re-fire loop (#871)
25+
26+
27+
### Changed
28+
- [config] Extract initialize_config() from discover_and_load()
29+
- Derive nightly toolchain from rust-toolchain.toml everywhere
30+
31+
32+
### Fixed
33+
- [tests] Stabilize flaky memory_config_get test
34+
- [ci] Pin NCCL version to match CUDA 12.4 container
35+
- [ci] Match NCCL dev headers to pre-installed runtime version
36+
- [ci] Skip libnccl-dev to work around llama-cpp-sys-2 linking bug
37+
- [ci] Remove pre-installed libnccl-dev from CUDA container
38+
- [providers] Link NCCL when llama-cpp-sys-2 compiles with GGML_USE_NCCL
39+
40+
41+
### Security
42+
- [ci] Use correct security list-keychains syntax for macOS codesign
43+
- [ci] Align macOS certificate import with working arbor pattern
44+
2245
## [20260425.09] - 2026-04-25
2346
### Added
2447
- [cron] Add heartbeat wake cooldown to prevent exec re-fire loop (#871)

crates/agents/src/json_repair.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,8 @@ pub fn repair_json(input: &str) -> Option<serde_json::Value> {
121121
'"' => in_string = true,
122122
'{' => stack.push('}'),
123123
'[' => stack.push(']'),
124-
'}' | ']' => {
125-
if stack.last() == Some(&ch) {
126-
stack.pop();
127-
}
124+
'}' | ']' if stack.last() == Some(&ch) => {
125+
stack.pop();
128126
},
129127
_ => {},
130128
}

crates/chat/src/types.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,11 @@ pub(crate) fn truncate_at_char_boundary(text: &str, max_bytes: usize) -> &str {
526526
/// Extract preview text from a single message JSON value.
527527
pub(crate) fn extract_preview_from_value(msg: &Value) -> Option<String> {
528528
fn message_text(msg: &Value) -> Option<String> {
529-
let text = if let Some(s) = msg.get("content").and_then(|v| v.as_str()) {
529+
let content = msg.get("content")?;
530+
let text = if let Some(s) = content.as_str() {
530531
s.to_string()
531-
} else if let Some(blocks) = msg.get("content").and_then(|v| v.as_array()) {
532+
} else {
533+
let blocks = content.as_array()?;
532534
blocks
533535
.iter()
534536
.filter_map(|b| {
@@ -540,8 +542,6 @@ pub(crate) fn extract_preview_from_value(msg: &Value) -> Option<String> {
540542
})
541543
.collect::<Vec<_>>()
542544
.join(" ")
543-
} else {
544-
return None;
545545
};
546546
let trimmed = text.trim();
547547
if trimmed.is_empty() {

crates/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ default = [
120120
"llm-compaction",
121121
"local-llm",
122122
"local-llm-metal",
123-
"matrix",
123+
# "matrix" excluded: matrix-sdk 0.16 compiler compat (nightly >= 2025-12-28)
124124
"mdns",
125125
"metrics",
126126
"ngrok",

crates/code-index/src/index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ impl CodeIndex {
657657
} else {
658658
raw_chunks
659659
.into_iter()
660-
.zip(embeddings.into_iter())
660+
.zip(embeddings)
661661
.enumerate()
662662
.map(|(idx, (chunk, embedding))| StoreChunk {
663663
file_path: chunk.file_path.clone(),

crates/config/src/defaults.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,13 @@ fn collect_shadowed_keys(
224224
(toml_edit::Item::Table(u), toml_edit::Item::Table(d)) => {
225225
collect_shadowed_keys(u, d, &mut path.clone(), out);
226226
},
227-
(toml_edit::Item::Value(u_val), toml_edit::Item::Value(d_val)) => {
227+
(toml_edit::Item::Value(u_val), toml_edit::Item::Value(d_val))
228228
// Only flag when the user value matches the default — that's
229229
// a true shadow (frozen default). Differing values are
230230
// intentional overrides and should not be reported.
231-
if u_val.to_string().trim() == d_val.to_string().trim() {
232-
out.push(path);
233-
}
231+
if u_val.to_string().trim() == d_val.to_string().trim() =>
232+
{
233+
out.push(path);
234234
},
235235
_ => {},
236236
}

crates/config/src/loader/config_io.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,10 @@ pub fn strip_default_values(effective: &mut toml_edit::Table, defaults: &toml_ed
460460
}
461461
}
462462
},
463-
(toml_edit::Item::Value(eff_val), toml_edit::Item::Value(def_val)) => {
464-
if values_equal(eff_val, def_val) {
465-
effective.remove(&key);
466-
}
463+
(toml_edit::Item::Value(eff_val), toml_edit::Item::Value(def_val))
464+
if values_equal(eff_val, def_val) =>
465+
{
466+
effective.remove(&key);
467467
},
468468
_ => {
469469
// Type mismatch (e.g. table vs value) → user override, keep it.
@@ -523,10 +523,10 @@ fn strip_new_default_values(
523523
}
524524
}
525525
},
526-
(toml_edit::Item::Value(eff_val), toml_edit::Item::Value(def_val)) => {
527-
if values_equal(eff_val, def_val) {
528-
effective.remove(&key);
529-
}
526+
(toml_edit::Item::Value(eff_val), toml_edit::Item::Value(def_val))
527+
if values_equal(eff_val, def_val) =>
528+
{
529+
effective.remove(&key);
530530
},
531531
_ => {},
532532
}

crates/cron/src/heartbeat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ pub fn is_within_active_hours(start: &str, end: &str, timezone: &str) -> bool {
143143
let end_minutes = if end == "24:00" {
144144
24 * 60
145145
} else {
146-
end_time.hour() as u32 * 60 + end_time.minute() as u32
146+
end_time.hour() * 60 + end_time.minute()
147147
};
148-
let start_minutes = start_time.hour() as u32 * 60 + start_time.minute() as u32;
148+
let start_minutes = start_time.hour() * 60 + start_time.minute();
149149

150150
let now_minutes = current_minutes(timezone);
151151

crates/gateway/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ default = [
108108
"graphql",
109109
"local-llm",
110110
"local-llm-metal",
111-
"matrix",
111+
# "matrix" excluded from defaults: matrix-sdk 0.16 hits compiler query-depth
112+
# limit on nightly >= 2025-12-28. Enable explicitly with --features matrix.
112113
"mdns",
113114
"metrics",
114115
"nostr",
@@ -153,7 +154,7 @@ metrics = [
153154
"dep:moltis-metrics",
154155
"moltis-chat/metrics",
155156
"moltis-discord/metrics",
156-
"moltis-matrix/metrics",
157+
"moltis-matrix?/metrics",
157158
"moltis-metrics/sqlite",
158159
"moltis-msteams/metrics",
159160
"moltis-nostr?/metrics",

crates/gateway/src/session.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,11 @@ fn filter_ui_history(messages: Vec<Value>) -> Vec<Value> {
118118

119119
/// Extract text content from a single message Value.
120120
fn message_text(msg: &Value) -> Option<String> {
121-
let text = if let Some(s) = msg.get("content").and_then(|v| v.as_str()) {
121+
let content = msg.get("content")?;
122+
let text = if let Some(s) = content.as_str() {
122123
s.to_string()
123-
} else if let Some(blocks) = msg.get("content").and_then(|v| v.as_array()) {
124+
} else {
125+
let blocks = content.as_array()?;
124126
blocks
125127
.iter()
126128
.filter_map(|b| {
@@ -132,8 +134,6 @@ fn message_text(msg: &Value) -> Option<String> {
132134
})
133135
.collect::<Vec<_>>()
134136
.join(" ")
135-
} else {
136-
return None;
137137
};
138138
let trimmed = text.trim();
139139
if trimmed.is_empty() {

0 commit comments

Comments
 (0)