Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature difference between PngEncoder::new and JpegEncoder::new #1605

Closed
Void1315 opened this issue Nov 5, 2021 · 1 comment · Fixed by #1608
Closed

Signature difference between PngEncoder::new and JpegEncoder::new #1605

Void1315 opened this issue Nov 5, 2021 · 1 comment · Fixed by #1608

Comments

@Void1315
Copy link

Void1315 commented Nov 5, 2021

pub fn new(w: W) -> PngEncoder<W>
// w is different types
pub fn new(w: &mut W) -> JpegEncoder<W>

I'm a newly rustacean, may anyone help me

@fintelia
Copy link
Contributor

fintelia commented Nov 5, 2021

The short answer is that our API is inconsistent in a lot of places, and that is one of them. In reality both encoders should probably take an owned writer.

@HeroicKatora HeroicKatora changed the title Question: Sign diff between PngEncoder::new and JpegEncoder::new Signature difference between PngEncoder::new and JpegEncoder::new Nov 5, 2021
@HeroicKatora HeroicKatora mentioned this issue Nov 5, 2021
22 tasks
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 a pull request may close this issue.

2 participants