From e4f839b031177301e17388942dd0ecf4ddaa2f2b Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Sat, 5 Nov 2022 10:23:52 -0700 Subject: [PATCH] chore(justfile): dedup rustdoc command (#335) --- justfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index b5686561..c38295e2 100755 --- a/justfile +++ b/justfile @@ -26,6 +26,9 @@ _fmt := if env_var_or_default("GITHUB_ACTIONS", "") != "true" { "" } else { ``` } +# arguments to pass to all RustDoc invocations +_rustdoc := _cargo + " doc --no-deps --all-features --document-private-items" + # default recipe to display help information default: @echo "justfile for Mycelium" @@ -81,14 +84,13 @@ check-docs crate='': (build-docs crate '--cfg docsrs -Dwarnings') (test-docs cra # open RustDoc documentation for `crate` (or for the whole workspace). docs crate='' $RUSTDOCFLAGS='--cfg docsrs': (build-docs crate RUSTDOCFLAGS) - {{ _cargo }} doc \ + {{ _rustdoc }} \ {{ if crate == '' { '--workspace' } else { '--package' } }} {{ crate }} \ - --no-deps --all-features \ --open # build RustDoc documentation for the workspace. build-docs crate='' $RUSTDOCFLAGS='--cfg docsrs': - {{ _cargo }} doc --no-deps --all-features --document-private-items \ + {{ _rustdoc }} \ {{ if crate == '' { '--workspace' } else { '--package' } }} {{ crate }} \ {{ _fmt }}