Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Fix doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shawntabrizi committed Sep 4, 2019
1 parent 9a60704 commit ba2ec61
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
10 changes: 5 additions & 5 deletions srml/support/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl<T> 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! {
Expand Down Expand Up @@ -106,7 +106,7 @@ impl<T> 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! {
Expand All @@ -131,7 +131,7 @@ impl<T> 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! {
Expand All @@ -155,7 +155,7 @@ impl<T> 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;
Expand Down Expand Up @@ -183,7 +183,7 @@ impl<T> 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<u32> {}
Expand Down
3 changes: 3 additions & 0 deletions srml/support/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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<I: Instance=DefaultInstance> {
/// type Balance;
/// type Token;
Expand Down
6 changes: 4 additions & 2 deletions srml/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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]);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
/// # }
Expand Down
1 change: 1 addition & 0 deletions srml/support/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub use srml_metadata::{
///
/// Example:
/// ```
///# extern crate srml_support as support;
///# mod module0 {
///# pub trait Trait {
///# type Origin;
Expand Down
2 changes: 1 addition & 1 deletion srml/support/src/storage/storage_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//!
//! ```rust
//! #[macro_use]
//! extern crate support;
//! extern crate srml_support as support;
//!
//! type AuthorityId = [u8; 32];
//! type Balance = u64;
Expand Down
2 changes: 2 additions & 0 deletions srml/support/src/unsigned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ pub use crate::sr_primitives::ApplyError;
/// # Example
///
/// ```
/// # extern crate srml_support as support;
/// #
/// # mod timestamp {
/// # pub struct Module;
/// #
Expand Down

0 comments on commit ba2ec61

Please sign in to comment.