From 9b50cd9c8c7b62adf7a1ec3f43241026ebce51ff Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Wed, 27 Mar 2024 11:57:00 +0100 Subject: [PATCH] meta: minors fixes Signed-off-by: Vincenzo Palazzo --- fundamentals/src/lib.rs | 2 ++ fundamentals/src/types.rs | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fundamentals/src/lib.rs b/fundamentals/src/lib.rs index 284c9ed..5302b14 100644 --- a/fundamentals/src/lib.rs +++ b/fundamentals/src/lib.rs @@ -10,10 +10,12 @@ pub mod types; pub mod prelude { pub use crate::bitflag::*; pub use crate::bolt::*; + #[allow(unused_imports)] pub use crate::primitives::*; pub use crate::tlv::*; pub use crate::types::*; + // FIXME: make this a not std compatible #[macro_export] macro_rules! error { ($($msg:tt)*) => {{ diff --git a/fundamentals/src/types.rs b/fundamentals/src/types.rs index 5cc4635..92d9da1 100644 --- a/fundamentals/src/types.rs +++ b/fundamentals/src/types.rs @@ -8,7 +8,8 @@ use crate::prelude::*; /// generate a ToWire and FromWire trait on basic /// types that will be used in the `derive` proc macro. /// -/// EXPAND +/// EXPAND: +/// /// ```ingore /// type Foo = [u8, 32]; /// @@ -20,12 +21,11 @@ use crate::prelude::*; /// } /// /// impl FromWire for Foo { -/// fn from_write(reader: &mut R) -> Result<(), Error> { +/// fn from_wire(reader: &mut R) -> std::io::Result { /// // note that we know tha side here that is 32 /// let mut buffer = [0; 32]; -/// // FIXME: returnt the error in the `FromWire` -/// let _ = reader.read(&mut buffer).unwrap(); -/// buffer +/// reader.read_exact(&mut buff)?; +/// Ok(buff) /// } /// } /// ```