Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
drknzz authored and piotmag769 committed Jun 27, 2024
1 parent 90f44f1 commit e8cf0ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 9 additions & 3 deletions extensions/scarb-doc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ mod types;
struct Args {
#[command(flatten)]
packages_filter: PackagesFilter,

/// Generate the documentation.
#[arg(long)]
save: bool,
}

macro_rules! print_names {
Expand Down Expand Up @@ -53,9 +57,11 @@ fn main() -> Result<()> {

print_module(&crate_.root_module);

let path = PathBuf::from(crate_.root_module.name.as_str());
let doc_path = PathBuf::from("doc").join(path);
crate_.root_module.save_to_file_recursive(&doc_path)?;
if args.save {
let path = PathBuf::from(crate_.root_module.name.as_str());
let doc_path = PathBuf::from("doc").join(path);
crate_.root_module.save_to_file_recursive(&doc_path)?;
}

Ok(())
}
Expand Down
8 changes: 5 additions & 3 deletions extensions/scarb-doc/src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ impl Markdown for Trait {
}
}

macro_rules! impl_Md {
(for $($t:ty),+) => {
macro_rules! impl_md {
($t:ty) => {
$(impl Markdown for $t {
fn md_ref(&self) -> String {
format!(
Expand Down Expand Up @@ -231,4 +231,6 @@ macro_rules! impl_Md {
};
}

impl_Md!(for TraitConstant, TraitType, TraitFunction);
impl_md!(TraitConstant);
impl_md!(TraitType);
impl_md!(TraitFunction);

0 comments on commit e8cf0ea

Please sign in to comment.