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

Format Rust code #279

Closed
wants to merge 1 commit into from
Closed

Format Rust code #279

wants to merge 1 commit into from

Conversation

jayvdb
Copy link

@jayvdb jayvdb commented Oct 30, 2024

Previous PR #271 over a year old and has no feedback.

Older open PRs, also no feedback

I didnt see any closed PRs.

@fintelia
Copy link
Contributor

This project is in maintenance mode and not seeking further development. Additionally, reformatting PRs like this can really only be done by maintainers because manually reviewing every change in a PR like this would be both time consuming and pointless

@jayvdb
Copy link
Author

jayvdb commented Oct 30, 2024

We rely on the lossless functionality and have related fixes to submit. c.f. https://github.com/franklin-ai/jpeg-decoder/commits/main/

If you would like to re-do this PR yourself, here are the steps that I took

  1. added #[rustfmt::skip] before pub fn fill_default_mjpeg_tables( and the nicely formatted tables at https://github.com/image-rs/jpeg-decoder/blob/4035b7e/src/arch/wasm.rs#L245-L261 , so that rustfmt doesnt make a mess of them.
  2. In src/huffman.rs, src/parser.rs, src/upsampler.rs , src/worker/immediate.rs, tests/lib.rs, and tests/rayon*.rs , add a blank line between std, external and crate use statements, otherwise rustfmt (stable) will jumble them all up.
  3. Run cargo fmt

That is all.

@kornelski
Copy link
Contributor

This isn't an improvement. Every rustfmt change is making the code slightly worse, and peppers it with #[rustfmt::skip] unnecessarily.

If you have an editor that unconditionally reformats, then .rustfmt.toml with disable_all_formatting = true can help.

@kornelski kornelski closed this Oct 30, 2024
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