Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fields.rs: Make request_type function a const fn #142

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

ammubhave
Copy link
Contributor

Make request_type function in fields.rs a const fn so that it can used
to create const global variables.

Test: The following code now compiles

const CTRL_OUT: u8 = request_type(
    rusb::Direction::Out,
    rusb::RequestType::Vendor,
    rusb::Recipient::Device,
);

Make request_type function in fields.rs a const fn so that it can used
to create const global variables.

Test: The following code now compiles

```
const CTRL_OUT: u8 = request_type(
    rusb::Direction::Out,
    rusb::RequestType::Vendor,
    rusb::Recipient::Device,
);
```
@a1ien
Copy link
Owner

a1ien commented Aug 25, 2022

LGTM. Thanks

@a1ien a1ien merged commit 17fe36f into a1ien:master Aug 25, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants