Skip to content

Commit 11e740b

Browse files
chore(ci): satisfy workspace clippy
1 parent 8629e70 commit 11e740b

5 files changed

Lines changed: 17 additions & 16 deletions

File tree

crates/rustyred-core/src/graph_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,7 @@ impl RedCoreGraphStore {
21252125

21262126
fn should_snapshot_for(&self, txn_id: u64) -> bool {
21272127
let interval = self.options.snapshot_interval_writes;
2128-
interval > 0 && txn_id > self.snapshot_txn_id && txn_id % interval == 0
2128+
interval > 0 && txn_id > self.snapshot_txn_id && txn_id.is_multiple_of(interval)
21292129
}
21302130

21312131
fn write_snapshot(&mut self) -> GraphStoreResult<()> {

crates/rustyred-server/src/graph_sync.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ async fn handle_socket(state: AppState, tenant_id: String, room_id: String, sock
151151
}
152152
}
153153
Message::Ping(payload) => {
154-
if sink.send(Message::Pong(payload)).await.is_err() {
155-
break;
154+
match sink.send(Message::Pong(payload)).await {
155+
Ok(()) => {}
156+
Err(_) => break,
156157
}
157158
}
158159
Message::Close(_) => break,

crates/rustyred-server/src/memory.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,10 @@ pub struct RecallBody {
144144
#[serde(default)]
145145
pub include_low_fitness: bool,
146146
#[serde(default)]
147+
#[allow(dead_code)]
147148
pub include_consolidation_sources: bool,
148149
#[serde(default)]
150+
#[allow(dead_code)]
149151
pub consume_handoffs: bool,
150152
}
151153

@@ -207,6 +209,7 @@ pub struct SelfArchiveBody {
207209
#[serde(default)]
208210
pub reason: Option<String>,
209211
#[serde(default)]
212+
#[allow(dead_code)]
210213
pub actor: Option<String>,
211214
}
212215

@@ -347,9 +350,7 @@ fn strip_code(input: &str) -> String {
347350
}
348351
j += 1;
349352
}
350-
for _ in i..j {
351-
out.push(b' ');
352-
}
353+
out.resize(out.len() + (j - i), b' ');
353354
i = j;
354355
continue;
355356
}
@@ -362,9 +363,7 @@ fn strip_code(input: &str) -> String {
362363
if j < bytes.len() && bytes[j] == b'`' {
363364
j += 1;
364365
}
365-
for _ in i..j {
366-
out.push(b' ');
367-
}
366+
out.resize(out.len() + (j - i), b' ');
368367
i = j;
369368
continue;
370369
}
@@ -765,7 +764,7 @@ pub async fn memory_mentions_wait(
765764
let actor = body.actor.trim().to_string();
766765
let limit = body.limit.unwrap_or(20).min(200);
767766
let timeout = body.timeout_seconds.unwrap_or(30).min(120);
768-
let interval_ms = ((body.interval_seconds.unwrap_or(1.0)).max(0.1).min(5.0) * 1000.0) as u64;
767+
let interval_ms = ((body.interval_seconds.unwrap_or(1.0)).clamp(0.1, 5.0) * 1000.0) as u64;
769768

770769
let started = std::time::Instant::now();
771770
let deadline = std::time::Duration::from_secs(timeout);
@@ -1207,7 +1206,7 @@ pub async fn memory_self_revise(
12071206
let properties = Value::Object(props);
12081207

12091208
// Use prior labels (preserves verb kind) plus marker.
1210-
let mut labels: Vec<String> = prior.labels.iter().cloned().collect();
1209+
let mut labels: Vec<String> = prior.labels.to_vec();
12111210
if !labels.iter().any(|l| l == "MemoryAtom") {
12121211
labels.insert(0, "MemoryAtom".to_string());
12131212
}

crates/rustyred-server/src/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl AppState {
273273
if let (Some(lat), Some(lon)) = (lat, lon) {
274274
let _ = SpatialBackend::upsert(index.as_mut(), &node.id, lat, lon);
275275
} else {
276-
let _ = SpatialBackend::remove(index.as_mut(), &node.id);
276+
SpatialBackend::remove(index.as_mut(), &node.id);
277277
}
278278
}
279279
}

crates/rustyred-server/src/yjs_sync.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,9 @@ async fn handle_socket(
277277
}
278278
}
279279
Message::Ping(payload) => {
280-
if sink.send(Message::Pong(payload)).await.is_err() {
281-
break;
280+
match sink.send(Message::Pong(payload)).await {
281+
Ok(()) => {}
282+
Err(_) => break,
282283
}
283284
}
284285
Message::Close(_) => break,
@@ -457,6 +458,7 @@ impl ProvenanceSidecar {
457458
}
458459

459460
/// Blame: which actor authored the item carrying this yrs `client_id`.
461+
#[cfg(test)]
460462
pub(crate) fn writer_of(&self, client_id: u64) -> Option<&str> {
461463
self.clients.get(&client_id).map(|a| a.actor.as_str())
462464
}
@@ -482,8 +484,7 @@ mod tests {
482484
fn doc_text(doc: &Doc) -> String {
483485
let text = doc.get_or_insert_text("t");
484486
let txn = doc.transact();
485-
let content = text.get_string(&txn);
486-
content
487+
text.get_string(&txn)
487488
}
488489

489490
#[test]

0 commit comments

Comments
 (0)