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

Move regex-capi to 2021 & inline format-args #1109

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nyurik
Copy link

@nyurik nyurik commented Oct 16, 2023

This makes the code a bit easier to read and smaller.

The capi crate was updated to the 2021 edition to avoid accidental panic! and other edge cases with inlined formats.

Some of it was done with this command, and later fixed by hand:

 cargo clippy --workspace --allow-dirty --fix --benches --tests --bins -- -A clippy::all -W clippy::uninlined_format_args

This makes the code a bit easier to read and smaller.

Some of it was done with this command, and later fixed by hand:

```
 cargo clippy --workspace --allow-dirty --fix --benches --tests --bins -- -A clippy::all -W clippy::uninlined_format_args
 ```
@nyurik nyurik changed the title Inline format-args Move regex-capi to 2021 & inline format-args Oct 16, 2023
Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

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

Thank you! Just a couple of nits and this should be good to go.

@@ -11,7 +11,7 @@ description = """
A C API for Rust's regular expression library.
"""
workspace = ".."
edition = "2018"
edition = "2021"
Copy link
Member

Choose a reason for hiding this comment

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

Probably set rust-version = "1.65" for consistency with other crates?

&mut io::stderr(),
"panic unwind caught, aborting: {:?}",
msg);
let _ = writeln!(&mut io::stderr(), "panic unwind caught, aborting: {msg:?}");
Copy link
Member

Choose a reason for hiding this comment

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

I follow a 79 column (inclusive) rule. I'm kind of surprised rustfmt doesn't take care of this here... Oh, because it's in a macro. So it will need to be wrapped manually.

@nyurik
Copy link
Author

nyurik commented Oct 16, 2023

fixed

@nyurik
Copy link
Author

nyurik commented Oct 21, 2023

@BurntSushi hi, friendly ping - let me know if anything else is needed for this and other regex PRs. Thx!

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.

None yet

2 participants