diff --git a/src/lib.rs b/src/lib.rs index ccf182b..b4760a4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,11 +32,9 @@ //! a: u32 //! } //! -//! fn main() { -//! assert_eq!(offset_of!(HelpMeIAmTrappedInAStructFactory, a), 15); -//! assert_eq!(span_of!(HelpMeIAmTrappedInAStructFactory, a), 15..19); -//! assert_eq!(span_of!(HelpMeIAmTrappedInAStructFactory, help_me_before_they_ .. a), 0..15); -//! } +//! assert_eq!(offset_of!(HelpMeIAmTrappedInAStructFactory, a), 15); +//! assert_eq!(span_of!(HelpMeIAmTrappedInAStructFactory, a), 15..19); +//! assert_eq!(span_of!(HelpMeIAmTrappedInAStructFactory, help_me_before_they_ .. a), 0..15); //! ``` //! //! This functionality can be useful, for example, for checksum calculations: diff --git a/src/offset_of.rs b/src/offset_of.rs index df1c84a..f5a7ba6 100644 --- a/src/offset_of.rs +++ b/src/offset_of.rs @@ -103,10 +103,8 @@ macro_rules! _memoffset__offset_of_impl { /// c: [u8; 5] /// } /// -/// fn main() { -/// assert_eq!(offset_of!(Foo, a), 0); -/// assert_eq!(offset_of!(Foo, b), 4); -/// } +/// assert_eq!(offset_of!(Foo, a), 0); +/// assert_eq!(offset_of!(Foo, b), 4); /// ``` /// /// ## Notes @@ -133,9 +131,7 @@ macro_rules! offset_of { /// ``` /// use memoffset::offset_of_tuple; /// -/// fn main() { -/// assert!(offset_of_tuple!((u8, u32), 1) >= 0, "Tuples do not have a defined layout"); -/// } +/// assert!(offset_of_tuple!((u8, u32), 1) >= 0, "Tuples do not have a defined layout"); /// ``` #[cfg(tuple_ty)] #[macro_export(local_inner_macros)] @@ -186,9 +182,7 @@ macro_rules! _memoffset__offset_of_union_impl { /// foo64: i64, /// } /// -/// fn main() { -/// assert!(offset_of_union!(Foo, foo64) == 0); -/// } +/// assert!(offset_of_union!(Foo, foo64) == 0); /// ``` /// /// ## Note diff --git a/src/span_of.rs b/src/span_of.rs index 0ef9863..5543b92 100644 --- a/src/span_of.rs +++ b/src/span_of.rs @@ -81,15 +81,13 @@ macro_rules! _memoffset__compile_error { /// egg: [[u8; 4]; 4] /// } /// -/// fn main() { -/// assert_eq!(0..84, span_of!(Blarg, ..)); -/// assert_eq!(0..8, span_of!(Blarg, .. y)); -/// assert_eq!(0..64, span_of!(Blarg, ..= y)); -/// assert_eq!(0..8, span_of!(Blarg, x)); -/// assert_eq!(8..84, span_of!(Blarg, y ..)); -/// assert_eq!(0..8, span_of!(Blarg, x .. y)); -/// assert_eq!(0..64, span_of!(Blarg, x ..= y)); -/// } +/// assert_eq!(0..84, span_of!(Blarg, ..)); +/// assert_eq!(0..8, span_of!(Blarg, .. y)); +/// assert_eq!(0..64, span_of!(Blarg, ..= y)); +/// assert_eq!(0..8, span_of!(Blarg, x)); +/// assert_eq!(8..84, span_of!(Blarg, y ..)); +/// assert_eq!(0..8, span_of!(Blarg, x .. y)); +/// assert_eq!(0..64, span_of!(Blarg, x ..= y)); /// ``` #[macro_export(local_inner_macros)] macro_rules! span_of {