hive-c0re/swarm-*: drop clippy allows and dedupe unix_now + KV open_or_create
No behaviour change. Casts replaced by try_from / Duration math; schedules.rs reuses agent_renewal::unix_now; the five swarm-queue-client KV open-or-create copies share one private kv::open_or_create.
This commit is contained in:
parent
f53ccb2740
commit
b874d21cda
1 changed files with 74 additions and 133 deletions
|
|
@ -236,13 +236,8 @@ struct AgentAgg {
|
|||
skills: HashMap<String, u64>,
|
||||
}
|
||||
|
||||
#[allow(
|
||||
clippy::cast_sign_loss,
|
||||
clippy::cast_possible_truncation,
|
||||
reason = "v.max(0) clamps to a non-negative value first, so the i64->u64 cast is exact: no sign loss, and no truncation since u64 covers all non-negative i64"
|
||||
)]
|
||||
fn u64_from_i64(v: i64) -> u64 {
|
||||
v.max(0) as u64
|
||||
u64::try_from(v).unwrap_or(0)
|
||||
}
|
||||
|
||||
/// Aggregate one agent's turn-stats over `[from, now]`. Errors bubble
|
||||
|
|
|
|||
Loading…
Reference in a new issue