Skip to content

Conversation

@refcell
Copy link
Owner

@refcell refcell commented Feb 2, 2026

Summary

  • Add #[must_use] attribute to CodecError::new() in crates/traits/src/codec.rs
  • Add #[must_use] attribute to ValidationError::new() in crates/rpc/src/validator.rs

This ensures callers handle the returned error values rather than accidentally discarding them, consistent with other constructor methods in the codebase.

Changes

Adds the #[must_use] attribute to two error type constructors that were missing it.

Add #[must_use] attribute to CodecError::new() and ValidationError::new()
to ensure callers use the returned error value, consistent with other
constructor methods in the codebase.
Copy link
Owner Author

@refcell refcell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The #[must_use] annotations on error constructors ensure callers handle the returned values properly. This follows the established pattern in the codebase.

Note: ValidationError::invalid_params() is also missing #[must_use] (similar constructor), but that's minor and can be addressed separately.

@refcell refcell merged commit c87514b into main Feb 2, 2026
17 checks passed
@refcell refcell deleted the impl-alpha/must-use-errors-final branch February 2, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants