Skip to content

fix: conditional clippy lint allows for lifetime generics#361

Merged
RAprogramm merged 5 commits intomainfrom
fix/clippy-lifetime-lints
Jan 21, 2026
Merged

fix: conditional clippy lint allows for lifetime generics#361
RAprogramm merged 5 commits intomainfrom
fix/clippy-lifetime-lints

Conversation

@RAprogramm
Copy link
Owner

@RAprogramm RAprogramm commented Jan 21, 2026

Summary

  • Add conditional #[allow(clippy::elidable_lifetime_names, clippy::needless_lifetimes)] only when type has lifetime parameters
  • Prevents conflicts with project-level forbid directives
  • Add "no-std" category to crates.io metadata

Changes

  • New lint.rs module with lifetime_lint_allows helper
  • Apply conditional allows in Display and Error trait generation
  • Add "no-std" category to Cargo.toml

RAprogramm and others added 3 commits January 21, 2026 08:52
Add `#[allow(clippy::elidable_lifetime_names, clippy::needless_lifetimes)]`
only when the type has lifetime parameters. This prevents conflicts with
project-level `forbid` directives while suppressing false positives in
generated code.

Also add "no-std" category to crates.io metadata.

Changes:
- Add `lint.rs` module with `lifetime_lint_allows` helper
- Apply conditional allows in Display and Error trait generation
- Add "no-std" category to Cargo.toml
- masterror: 0.27.1 → 0.27.2
- masterror-derive: 0.11.1 → 0.11.2
- Update all dependencies via cargo update
@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 90.02625% with 38 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/app_error/inline_vec.rs 89.25% 33 Missing ⚠️
src/app_error/metadata.rs 84.37% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

Optimize Metadata to use inline storage for small field counts:

- Add InlineVec<T> with enum-based storage for 0-4 elements inline
- Replace BTreeMap with sorted InlineVec + binary search for O(log n) lookup
- Eliminate heap allocation for typical errors with 0-4 metadata fields
- Replace format! with write! in Display hot path

Expected ~100-200ns savings per error creation for common cases.

Changes:
- New inline_vec.rs module with safe, zero-dependency InlineVec
- Updated metadata.rs to use InlineVec with binary search
- Fixed Display impl in error.rs to avoid format! allocation
Remove reference to private InlineVec type in public documentation
to fix rustdoc lint error.
@RAprogramm RAprogramm merged commit 446525a into main Jan 21, 2026
27 checks passed
@RAprogramm RAprogramm deleted the fix/clippy-lifetime-lints branch January 21, 2026 02:45
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.

1 participant