Skip to content

Allow passing a constant's path into unsafe_protocol #760

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

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

nicholasbishop
Copy link
Member

For example, instead of this:

#[unsafe_protocol("12345678-1234-5678-1234-567812345678")]

You can do this:

#[unsafe_protocol(path::of::some::guid::constant)]

This is helpful to avoid repeating the GUID if you happen to have it defined somewhere else already.

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

For example, instead of this:

`#[unsafe_protocol("12345678-1234-5678-1234-567812345678")]`

You can do this:

`#[unsafe_protocol(path::of::some::guid::constant)]`

This is helpful to avoid repeating the GUID if you happen to have it defined
somewhere else already.
@phip1611
Copy link
Member

Nice! I think, it would be good to have a small unit test to ensure that both variants compile.

@nicholasbishop
Copy link
Member Author

The docstring example gets run during unit tests, so I think we're good there.

@phip1611
Copy link
Member

Ah, right. Sorry, I missed that.

@phip1611 phip1611 merged commit b5d0f49 into rust-osdev:main Apr 13, 2023
@nicholasbishop nicholasbishop deleted the bishop-guid-const branch April 14, 2023 00:19
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