Skip to content

main.rs:1914: u128→u64 truncation silently overflows for long-running diffguard processes #428

@EffortlessSteven

Description

@EffortlessSteven

Location:

Issue: returns , which is then truncated to with . For a process running longer than ~584 million years, this silently overflows.

Why this matters: The API was changed to return specifically to avoid this truncation on 64-bit platforms where is insufficient. Using defeats the purpose of the return type.

Fix: Use for checked conversion, or match on the and handle overflow explicitly:

Or, since duration is unlikely to overflow in practice, at minimum use per clippy guidance.

References:

  • lint
  • Related issue filed for truncation in DiffStats
  • Related issue filed for cast using instead of

Effort: Low — one-line fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogBacklog — not currently prioritized, TBD

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions