Repository navigation
refactor: add #[must_use] to public Result/Option functions (#2123) - #4004
Merged
Merged
Conversation
Annotate ~100 public functions returning Result or Option across 6 core crates (checksums, protocol, engine, transfer, filters, signature) with #[must_use] to catch silently-ignored return values at compile time. Focused on constructors, parsers, decoders, accessors, and factory functions where ignoring the return value is almost certainly a bug. Skipped side-effecting I/O writes and mutations where the function is called for its effect rather than its return value.
Removes #[must_use] (no message) from public functions returning Result<T, E> or Option<T> across the workspace. The standard library already marks both types as #[must_use], so the function-level annotation is redundant and triggers clippy's double_must_use lint under -D warnings. Also adds `let _ =` to test call sites that discard `PipelineState::pop()` return values, since Option's inherent #[must_use] still flags them.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…4004) * refactor: add #[must_use] to public Result/Option functions (#2123) Annotate ~100 public functions returning Result or Option across 6 core crates (checksums, protocol, engine, transfer, filters, signature) with #[must_use] to catch silently-ignored return values at compile time. Focused on constructors, parsers, decoders, accessors, and factory functions where ignoring the return value is almost certainly a bug. Skipped side-effecting I/O writes and mutations where the function is called for its effect rather than its return value. * fix: remove redundant #[must_use] on Result-returning functions * fix: remove redundant #[must_use] from checksums Result/Option fns * fix: remove redundant #[must_use] from signature async_gen * fix: remove redundant #[must_use] and fix unused return values in engine * fix: remove redundant #[must_use] from all Result/Option fns Removes #[must_use] (no message) from public functions returning Result<T, E> or Option<T> across the workspace. The standard library already marks both types as #[must_use], so the function-level annotation is redundant and triggers clippy's double_must_use lint under -D warnings. Also adds `let _ =` to test call sites that discard `PipelineState::pop()` return values, since Option's inherent #[must_use] still flags them.
6 tasks
oferchen
added a commit
that referenced
this pull request
Jun 10, 2026
Adds a fourth IoUringPolicy variant (SqpollOff) wired to the new --no-io-uring-sqpoll flag. The variant keeps io_uring active for file and socket I/O but suppresses IORING_SETUP_SQPOLL via a process-wide gate that build_ring() and the session-pool ring builder consult. This gives operators a deterministic opt-out for rootless containers and Kubernetes pods that cannot grant CAP_SYS_NICE, instead of relying on the kernel's EPERM fallback path. Adds docs/deployment/kubernetes.md covering Pod manifests for SQPOLL-enabled and SQPOLL-suppressed workloads, daemon-as-Pod deployment, Pod Security Admission profile interactions, and the tradeoff table. Extends docs/deployment/container-io-uring.md (IKV-F.6) with a K8s rootless-opt-out subsection and adds the new flag to docs/deployment/io-uring-feature-matrix.md. Bundles SQP-K8S.1 / .3 / .4 (#4004 / #4006 / #4007). The rootless throughput bench (SQP-K8S.2) requires container access and is deferred to a follow-up PR.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…4004) * refactor: add #[must_use] to public Result/Option functions (#2123) Annotate ~100 public functions returning Result or Option across 6 core crates (checksums, protocol, engine, transfer, filters, signature) with #[must_use] to catch silently-ignored return values at compile time. Focused on constructors, parsers, decoders, accessors, and factory functions where ignoring the return value is almost certainly a bug. Skipped side-effecting I/O writes and mutations where the function is called for its effect rather than its return value. * fix: remove redundant #[must_use] on Result-returning functions * fix: remove redundant #[must_use] from checksums Result/Option fns * fix: remove redundant #[must_use] from signature async_gen * fix: remove redundant #[must_use] and fix unused return values in engine * fix: remove redundant #[must_use] from all Result/Option fns Removes #[must_use] (no message) from public functions returning Result<T, E> or Option<T> across the workspace. The standard library already marks both types as #[must_use], so the function-level annotation is redundant and triggers clippy's double_must_use lint under -D warnings. Also adds `let _ =` to test call sites that discard `PipelineState::pop()` return values, since Option's inherent #[must_use] still flags them.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…4004) * refactor: add #[must_use] to public Result/Option functions (#2123) Annotate ~100 public functions returning Result or Option across 6 core crates (checksums, protocol, engine, transfer, filters, signature) with #[must_use] to catch silently-ignored return values at compile time. Focused on constructors, parsers, decoders, accessors, and factory functions where ignoring the return value is almost certainly a bug. Skipped side-effecting I/O writes and mutations where the function is called for its effect rather than its return value. * fix: remove redundant #[must_use] on Result-returning functions * fix: remove redundant #[must_use] from checksums Result/Option fns * fix: remove redundant #[must_use] from signature async_gen * fix: remove redundant #[must_use] and fix unused return values in engine * fix: remove redundant #[must_use] from all Result/Option fns Removes #[must_use] (no message) from public functions returning Result<T, E> or Option<T> across the workspace. The standard library already marks both types as #[must_use], so the function-level annotation is redundant and triggers clippy's double_must_use lint under -D warnings. Also adds `let _ =` to test call sites that discard `PipelineState::pop()` return values, since Option's inherent #[must_use] still flags them.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Adds a fourth IoUringPolicy variant (SqpollOff) wired to the new --no-io-uring-sqpoll flag. The variant keeps io_uring active for file and socket I/O but suppresses IORING_SETUP_SQPOLL via a process-wide gate that build_ring() and the session-pool ring builder consult. This gives operators a deterministic opt-out for rootless containers and Kubernetes pods that cannot grant CAP_SYS_NICE, instead of relying on the kernel's EPERM fallback path. Adds docs/deployment/kubernetes.md covering Pod manifests for SQPOLL-enabled and SQPOLL-suppressed workloads, daemon-as-Pod deployment, Pod Security Admission profile interactions, and the tradeoff table. Extends docs/deployment/container-io-uring.md (IKV-F.6) with a K8s rootless-opt-out subsection and adds the new flag to docs/deployment/io-uring-feature-matrix.md. Bundles SQP-K8S.1 / .3 / .4 (#4004 / #4006 / #4007). The rootless throughput bench (SQP-K8S.2) requires container access and is deferred to a follow-up PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#[must_use]annotations to ~105 public functions returningResultorOptionacross 6 core crates: checksums, protocol, engine, transfer, filters, and signatureCrate breakdown
Selection criteria
Added to:
from_*constructors,parse/decodefunctions,read_*deserializers,open/newfactories, pure getters returningOption,build()methods,try_acquire/try_recvpolling methods, iterator-likenext_*methods.Skipped:
write_*/send_*/flush_*I/O methods (side-effecting),update_reader*(mutation + I/O),roll/roll_many(mutation returning Result for error signaling), private/crate-internal functions, trait method declarations, functions already annotated.Test plan
#[must_use]does not produceunused_must_useunless callers actually discard the value)