Skip to content

Commit

Permalink
chore: resolve unreachable code warning when building docs (#4335)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Supercedes #4325 

## Summary\*

This PR resolves the warning produced when building the version of nargo
use to codegen reference docs.

## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [x] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

Co-authored-by: kevaundray <kevtheappdev@gmail.com>
  • Loading branch information
TomAFrench and kevaundray authored Feb 12, 2024
1 parent 05e78b3 commit be6e8eb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tooling/nargo_cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ enum NargoCommand {
Dap(dap_cmd::DapCommand),
}

#[cfg(not(feature = "codegen-docs"))]
pub(crate) fn start_cli() -> eyre::Result<()> {
#[cfg(feature = "codegen-docs")]
return codegen_docs();

let NargoCli { command, mut config } = NargoCli::parse();

// If the provided `program_dir` is relative, make it absolute by joining it to the current directory.
Expand Down Expand Up @@ -131,7 +129,7 @@ pub(crate) fn start_cli() -> eyre::Result<()> {
}

#[cfg(feature = "codegen-docs")]
fn codegen_docs() -> eyre::Result<()> {
pub(crate) fn start_cli() -> eyre::Result<()> {
let markdown: String = clap_markdown::help_markdown::<NargoCli>();
println!("{markdown}");
Ok(())
Expand Down

0 comments on commit be6e8eb

Please sign in to comment.