From ba2ec61da7acc36821a70e76a31a6a5bf13bbe95 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Wed, 4 Sep 2019 02:21:25 +0200 Subject: [PATCH] Fix doc tests --- srml/support/src/dispatch.rs | 10 +++++----- srml/support/src/event.rs | 3 +++ srml/support/src/lib.rs | 6 ++++-- srml/support/src/metadata.rs | 1 + srml/support/src/storage/storage_items.rs | 2 +- srml/support/src/unsigned.rs | 2 ++ 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/srml/support/src/dispatch.rs b/srml/support/src/dispatch.rs index fd6dd001e6bf3..9a720bdb52783 100644 --- a/srml/support/src/dispatch.rs +++ b/srml/support/src/dispatch.rs @@ -66,7 +66,7 @@ impl Parameter for T where T: Codec + Clone + Eq {} /// /// ``` /// # #[macro_use] -/// # extern crate support; +/// # extern crate srml_support as support; /// # use support::dispatch::Result; /// # use srml_system::{self as system, Trait, ensure_signed}; /// decl_module! { @@ -106,7 +106,7 @@ impl Parameter for T where T: Codec + Clone + Eq {} /// /// ``` /// # #[macro_use] -/// # extern crate support; +/// # extern crate srml_support as support; /// # use support::dispatch::Result; /// # use srml_system::{self as system, Trait, ensure_signed}; /// decl_module! { @@ -131,7 +131,7 @@ impl Parameter for T where T: Codec + Clone + Eq {} /// /// ``` /// # #[macro_use] -/// # extern crate support; +/// # extern crate srml_support as support; /// # use support::dispatch::Result; /// # use srml_system::{self as system, Trait, ensure_signed, ensure_root}; /// decl_module! { @@ -155,7 +155,7 @@ impl Parameter for T where T: Codec + Clone + Eq {} /// /// ``` /// # #[macro_use] -/// # extern crate support; +/// # extern crate srml_support as support; /// # use support::dispatch::Result; /// # use srml_system::{self as system, ensure_signed}; /// # pub struct DefaultInstance; @@ -183,7 +183,7 @@ impl Parameter for T where T: Codec + Clone + Eq {} /// /// ``` /// # #[macro_use] -/// # extern crate support; +/// # extern crate srml_support as support; /// # use support::dispatch::Result; /// # use srml_system::{self as system, ensure_signed}; /// pub trait Trait: system::Trait where Self::AccountId: From {} diff --git a/srml/support/src/event.rs b/srml/support/src/event.rs index 9b3876e0732b0..be2ccc442db7b 100644 --- a/srml/support/src/event.rs +++ b/srml/support/src/event.rs @@ -24,6 +24,7 @@ pub use srml_metadata::{EventMetadata, DecodeDifferent, OuterEventMetadata, FnEn /// # Simple Event Example: /// /// ```rust +/// # extern crate srml_support as support; /// support::decl_event!( /// pub enum Event { /// Success, @@ -37,6 +38,7 @@ pub use srml_metadata::{EventMetadata, DecodeDifferent, OuterEventMetadata, FnEn /// # Generic Event Example: /// /// ```rust +/// # extern crate srml_support as support; /// trait Trait { /// type Balance; /// type Token; @@ -82,6 +84,7 @@ pub use srml_metadata::{EventMetadata, DecodeDifferent, OuterEventMetadata, FnEn ///# struct DefaultInstance; ///# trait Instance {} ///# impl Instance for DefaultInstance {} +/// # extern crate srml_support as support; /// trait Trait { /// type Balance; /// type Token; diff --git a/srml/support/src/lib.rs b/srml/support/src/lib.rs index 4cb1df1ca0adb..7d28c28e102d3 100644 --- a/srml/support/src/lib.rs +++ b/srml/support/src/lib.rs @@ -185,7 +185,7 @@ macro_rules! assert_ok { /// /// ```rust /// #[macro_use] -/// # extern crate support; +/// # extern crate srml_support as support; /// # use support::{assert_eq_uvec}; /// # fn main() { /// assert_eq_uvec!(vec![1,2], vec![2,1]); @@ -194,7 +194,7 @@ macro_rules! assert_ok { /// /// ```rust,should_panic /// #[macro_use] -/// # extern crate support; +/// # extern crate srml_support as support; /// # use support::{assert_eq_uvec}; /// # fn main() { /// assert_eq_uvec!(vec![1,2,3], vec![2,1]); @@ -225,6 +225,7 @@ macro_rules! __assert_eq_uvec { /// # Example /// /// ```rust +/// # extern crate srml_support as support; /// # fn main() { /// support::assert_eq_error_rate!(10, 10, 0); /// support::assert_eq_error_rate!(10, 11, 1); @@ -233,6 +234,7 @@ macro_rules! __assert_eq_uvec { /// ``` /// /// ```rust,should_panic +/// # extern crate srml_support as support; /// # fn main() { /// support::assert_eq_error_rate!(12, 10, 1); /// # } diff --git a/srml/support/src/metadata.rs b/srml/support/src/metadata.rs index 3daeca21e4176..4a550c2daa421 100644 --- a/srml/support/src/metadata.rs +++ b/srml/support/src/metadata.rs @@ -24,6 +24,7 @@ pub use srml_metadata::{ /// /// Example: /// ``` +///# extern crate srml_support as support; ///# mod module0 { ///# pub trait Trait { ///# type Origin; diff --git a/srml/support/src/storage/storage_items.rs b/srml/support/src/storage/storage_items.rs index 3eb7702161901..aae4773295335 100644 --- a/srml/support/src/storage/storage_items.rs +++ b/srml/support/src/storage/storage_items.rs @@ -27,7 +27,7 @@ //! //! ```rust //! #[macro_use] -//! extern crate support; +//! extern crate srml_support as support; //! //! type AuthorityId = [u8; 32]; //! type Balance = u64; diff --git a/srml/support/src/unsigned.rs b/srml/support/src/unsigned.rs index debca235ec13a..3e37a5c8dd3ea 100644 --- a/srml/support/src/unsigned.rs +++ b/srml/support/src/unsigned.rs @@ -28,6 +28,8 @@ pub use crate::sr_primitives::ApplyError; /// # Example /// /// ``` +/// # extern crate srml_support as support; +/// # /// # mod timestamp { /// # pub struct Module; /// #