Skip to content

Commit

Permalink
reproduce #9
Browse files Browse the repository at this point in the history
  • Loading branch information
sam0x17 committed Sep 20, 2023
1 parent 88d6db7 commit ba5e615
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ pub struct OliverExample2;
#[doc = docify::embed!("examples/samples.rs", LiamIssue7)]
pub struct LiamExample;

/// This is Liam's issue #9
#[doc = docify::embed!("examples/samples.rs", trait_impl_method)]
pub struct LiamExample9;

/// This will compile all markdown files in the `markdown_source` directory to `markdown_bin`
/// when `cargo doc` is run, handling any doc embed calls as it goes
#[cfg(doc)]
Expand Down
32 changes: 32 additions & 0 deletions examples/samples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,35 @@ mod some_module {
struct LiamIssue7;

fn main() {}

trait SomeTrait {
fn trait_impl_method();
}

pub struct Liam9;

impl SomeTrait for Liam9 {
#[docify::export]
fn trait_impl_method() {
println!("foo!");
}
}

// #[cfg(feature = "fake")]
// #[pallet::call]
// impl<T: Config> Pallet<T> {
// #[pallet::call_index(0)]
// #[docify::export(set_value)]
// pub fn set_value(origin: OriginFor<T>, value: u32) -> DispatchResult {
// ensure_signed(origin)?;

// let previous = Value::<T>::get().map(|v| v.current);
// let new_struct = CurrentAndPreviousValue {
// current: value,
// previous,
// };
// <Value<T>>::put(new_struct);

// Ok(())
// }
// }

0 comments on commit ba5e615

Please sign in to comment.