Skip to content

Conversation

bjorn3
Copy link
Contributor

@bjorn3 bjorn3 commented Jun 9, 2024

This makes PCI drivers slightly easier to write. Redox OS has the same methods on it's counterpart to the Bar type of this crate.

@@ -7,7 +7,7 @@ description = "Library with types for handling PCI devices"
categories = ["hardware-support", "no-std"]
readme = "README.md"
license = "MIT/Apache-2.0"
edition = "2018"
edition = "2021"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The 2021 edition has TryInto in the prelude. If preferred I can manually import it instead.

Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

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

I think calling these methods unwrap_io and unwrap_mem would be more consistent with std, since they don't take a message string. See Result::expect_err and Result::unwrap_err.

This makes PCI drivers slightly easier to write. Redox OS has the same
methods on it's counterpart to the Bar type of this crate.
@bjorn3 bjorn3 changed the title Add expect_io and expect_mem convenience methods on Bar Add unwrap_io and unwrap_mem convenience methods on Bar Jun 10, 2024
@bjorn3
Copy link
Contributor Author

bjorn3 commented Jun 10, 2024

Done

@IsaacWoods IsaacWoods merged commit 2c1c472 into rust-osdev:main Jun 14, 2024
@bjorn3 bjorn3 deleted the bar_helpers branch June 15, 2024 04:46
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.

3 participants