Skip to content

workspace: use workspace dependencies #148

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
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ members = [
"multiboot2-header",
]

[workspace.dependencies]
bitflags = "2"
derive_more = { version = "0.99", default-features = false, features = ["display"] }
log = { version = "0.4", default-features = false }

# This way, the "multiboot2" dependency in the multiboot2-header crate can be
# referenced by version, while still the repository version is used
Expand Down
6 changes: 6 additions & 0 deletions multiboot2-header/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,11 @@ builder = ["alloc"]
unstable = []

[dependencies]
# Not yet used.
# bitflags.workspace = true
derive_more.workspace = true
# Not yet used.
# log.workspace = true

# used for MBI tags
multiboot2 = "0.16.0"
10 changes: 2 additions & 8 deletions multiboot2-header/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
RelocatableHeaderTag,
};
use core::convert::TryInto;
use core::fmt::{Debug, Display, Formatter};
use core::fmt::{Debug, Formatter};
use core::mem::size_of;

/// Magic value for a [`Multiboot2Header`], as defined in spec.
Expand Down Expand Up @@ -200,7 +200,7 @@ impl<'a> Debug for Multiboot2Header<'a> {

/// Errors that can occur when parsing a header from a slice.
/// See [`Multiboot2Header::find_header`].
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Copy, Clone, Debug, derive_more::Display, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum LoadError {
/// The checksum does not match the data.
ChecksumMismatch,
Expand All @@ -212,12 +212,6 @@ pub enum LoadError {
TooSmall,
}

impl Display for LoadError {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
write!(f, "{:?}", self)
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for LoadError {}

Expand Down
7 changes: 4 additions & 3 deletions multiboot2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ builder = ["alloc"]
unstable = []

[dependencies]
bitflags = "2"
derive_more = { version = "0.99", default-features = false, features = ["display"] }
log = { version = "0.4", default-features = false }
bitflags.workspace = true
derive_more.workspace = true
log.workspace = true

uefi-raw = { version = "0.2.0", default-features = false }
ptr_meta = { version = "0.2.0", default-features = false }