Skip to content

Remove deprecated constructor for HdrDecoder#2865

Open
RunDevelopment wants to merge 2 commits intoimage-rs:mainfrom
RunDevelopment:rm-depr-hdr
Open

Remove deprecated constructor for HdrDecoder#2865
RunDevelopment wants to merge 2 commits intoimage-rs:mainfrom
RunDevelopment:rm-depr-hdr

Conversation

@RunDevelopment
Copy link
Member

I removed the deprecated and internally unused new_nonstrict constructor for HdrDecoder.

This is the last deprecated item in image.

@fintelia
Copy link
Contributor

This method was only deprecated 3 weeks ago, and the deprecation note points at a method that isn't public. I think this might need a bit more attention first...

@RunDevelopment
Copy link
Member Author

Good catch! I didn't check when it was deprecated.

I think just explaining things a bit more in the docs of new and with_strictness should clear things up.

Also, should with_strictness be renamed to new_with_strictness? Sounds more like a constructor.

@197g
Copy link
Member

197g commented Mar 15, 2026

Since Rust has no special 'constructor', new_ as part of names is superfluous. If you look at the standard library then from_ and with_ are both heavily used (with the former preferred where the latter could mistaken for a builder pattern).

@RunDevelopment
Copy link
Member Author

Special or not, what's a constructor if not a static factory method? I just like to call them that here, since that's what their role is.

But after looking at BufReader::with_capacity, I think with_strictness should be okay.

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.

3 participants