Skip to content

Remove deprecated constructor for HdrDecoder - #2865

Open
RunDevelopment wants to merge 3 commits into
image-rs:mainfrom
RunDevelopment:rm-depr-hdr
Open

RunDevelopment wants to merge 3 commits into
image-rs:mainfrom
RunDevelopment:rm-depr-hdr

Conversation

@RunDevelopment

Copy link
Copy Markdown
Member

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

This is the last deprecated item in image.

@fintelia

Copy link
Copy Markdown
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
Copy Markdown
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

197g commented Mar 15, 2026

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

@mstoeckl mstoeckl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, but needs rebase.

This branch has not been deployed

No deployments
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.

4 participants