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

Streamline error API #2

Closed
wants to merge 4 commits into from
Closed

Streamline error API #2

wants to merge 4 commits into from

Conversation

TedDriggs
Copy link

This implements the proposed API changes from #1.

rules.entry(syscall)
.or_insert_with(Vec::new)
.push(rule);
rules.entry(syscall).or_insert_with(Vec::new).push(rule);
Copy link
Author

Choose a reason for hiding this comment

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

I have my editor set to auto-run rustfmt on save, so this change came about because of that. I did put the formatting update as its own first commit so it should be easy to remove if you prefer it be skipped.

Copy link
Owner

Choose a reason for hiding this comment

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

yes, unfortunately rustfmt makes a lot of decisions that make these kinds of statements uglier (while at the same time putting .unwrap() on newlines) so I end up just running it on diffs and manually taking the suggestions, which is not optimal.

The new names more closely match stdlib and popular library conventions.
The function is now precise in which error it can emit.

Fixes #1
This pull request was closed.
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.

2 participants