Explorar o código

Merge pull request #148 from rust-osdev/dev3

workspace: use workspace dependencies
Philipp Schuster hai 1 ano
pai
achega
1e1ef79c1d
Modificáronse 5 ficheiros con 17 adicións e 11 borrados
  1. 1 0
      Cargo.lock
  2. 4 0
      Cargo.toml
  3. 6 0
      multiboot2-header/Cargo.toml
  4. 2 8
      multiboot2-header/src/header.rs
  5. 4 3
      multiboot2/Cargo.toml

+ 1 - 0
Cargo.lock

@@ -40,6 +40,7 @@ dependencies = [
 name = "multiboot2-header"
 version = "0.3.0"
 dependencies = [
+ "derive_more",
  "multiboot2",
 ]
 

+ 4 - 0
Cargo.toml

@@ -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

+ 6 - 0
multiboot2-header/Cargo.toml

@@ -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"

+ 2 - 8
multiboot2-header/src/header.rs

@@ -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.
@@ -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,
@@ -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 {}
 

+ 4 - 3
multiboot2/Cargo.toml

@@ -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 }