Skip to content

Remove unnecessary 'static bounds#2869

Merged
197g merged 1 commit intoimage-rs:mainfrom
RunDevelopment:rm-static
Mar 16, 2026
Merged

Remove unnecessary 'static bounds#2869
197g merged 1 commit intoimage-rs:mainfrom
RunDevelopment:rm-static

Conversation

@RunDevelopment
Copy link
Member

A lot of functions generic over pixels had 'static bounds for pixels and subpixels. Frankly, I have no idea why they had these bounds. Everything compiles without them. I also checked whether there was some unsafe code relying on static lifetimes, but there wasn't. The bounds seem completely unnecessary.

So I removed them all. I checked every 'static bounds and removed the unnecessary ones.

If there is a reason why these bounds exist and should be kept, please tell me.

Copy link
Member

@197g 197g left a comment

Choose a reason for hiding this comment

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

They were at some point necessary. I don't fully recall all the details, but removed some others a while back. In any case it would be necessary if Any was involved for downcasting anywhere but sealing of the trait should have made any that direction redundant; no longer something to consider as a future possibility.

@197g 197g merged commit ab59f0c into image-rs:main Mar 16, 2026
31 checks passed
@RunDevelopment RunDevelopment deleted the rm-static branch March 16, 2026 23:58
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