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

improve usage of unsafe in gix-pack #1233

Merged
merged 1 commit into from
Jan 4, 2024
Merged

improve usage of unsafe in gix-pack #1233

merged 1 commit into from
Jan 4, 2024

Conversation

Byron
Copy link
Owner

@Byron Byron commented Jan 4, 2024

Inspired by #1231 (comment) .

  • make sure the type in question isn't use outside of its designated module
  • improve documentation around safety to make the underlying data structure
    more obvious.

Inspired by #1231 (comment) .

- make sure the type in question isn't use outside of its designated module
- improve documentation around safety to make the underlying data structure
  more obvious.
@Byron Byron merged commit 4017e69 into main Jan 4, 2024
18 checks passed
@Byron Byron deleted the unsafe-in-pack branch January 4, 2024 07:17
@@ -68,7 +71,7 @@ mod node {
}
}

pub(crate) struct State<'items, F, MBFN, T: Send> {
pub(in crate::cache::delta::traverse) struct State<'items, F, MBFN, T: Send> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can do pub(super)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also think the invariant should be mentioned on the fields that have them.

Copy link
Contributor

Choose a reason for hiding this comment

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

and it's those fields that should be visibility restricted

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks a lot, I tried to apply this feedback in 696cbb8 (shoehorned into my current feature-PR).

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