diff --git a/earthly/rust/scripts/std_build.sh b/earthly/rust/scripts/std_build.sh index da92a7fb1..74440f4f7 100755 --- a/earthly/rust/scripts/std_build.sh +++ b/earthly/rust/scripts/std_build.sh @@ -43,28 +43,35 @@ status $rc "Checking Benchmarks all run to completion" \ cargo bench --all-targets; rc=$? ## Generate dependency graphs -cargo depgraph --workspace-only --dedup-transitive-deps > target/doc/workspace.dot -cargo depgraph --dedup-transitive-deps > target/doc/full.dot -cargo depgraph --all-deps --dedup-transitive-deps > target/doc/all.dot +status $rc "Generating workspace dependency graphs" \ + $(cargo depgraph --workspace-only --dedup-transitive-deps > target/doc/workspace.dot); rc=$? +status $rc "Generating full dependency graphs" \ + $(cargo depgraph --dedup-transitive-deps > target/doc/full.dot); rc=$? +status $rc "Generating all dependency graphs" \ + $(cargo depgraph --all-deps --dedup-transitive-deps > target/doc/all.dot); rc=$? export NO_COLOR=1 ## Generate Module Trees for documentation purposes. for lib in $1; do - cargo modules generate tree --orphans --types --traits --tests --all-features \ - --package $lib --lib > target/doc/$lib.lib.modules.tree; rc=$? + status $rc "Generate Module Trees for $lib" \ + $(cargo modules generate tree --orphans --types --traits --tests --all-features \ + --package $lib --lib > target/doc/$lib.lib.modules.tree); rc=$? - cargo modules generate graph --all-features --modules \ - --package $lib --lib > target/doc/$lib.lib.modules.dot; rc=$? + status $rc "Generate Module Graphs for $lib" \ + $(cargo modules generate graph --all-features --modules \ + --package $lib --lib > target/doc/$lib.lib.modules.dot); rc=$? done for bin in $2; do IFS="/" read -r package bin <<< "$bin" - cargo modules generate tree --orphans --types --traits --tests --all-features \ - --package $package --bin $bin > target/doc/$package.$bin.bin.modules.tree; rc=$? + status $rc "Generate Module Trees for $package/$bin" \ + $(cargo modules generate tree --orphans --types --traits --tests --all-features \ + --package $package --bin $bin > target/doc/$package.$bin.bin.modules.tree); rc=$? - cargo modules generate graph --all-features --modules \ - --package $package --bin $bin > target/doc/$package.$bin.bin.modules.dot; rc=$? + status $rc "Generate Module Graphs for $package/$bin" \ + $(cargo modules generate graph --all-features --modules \ + --package $package --bin $bin > target/doc/$package.$bin.bin.modules.dot); rc=$? done # Return an error if any of this fails. diff --git a/examples/rust/Cargo.lock b/examples/rust/Cargo.lock index ee87be571..363a4913f 100644 --- a/examples/rust/Cargo.lock +++ b/examples/rust/Cargo.lock @@ -73,7 +73,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bar" -version = "0.1.0" +version = "0.0.1" [[package]] name = "bitflags" @@ -259,7 +259,7 @@ dependencies = [ [[package]] name = "foo" -version = "0.1.0" +version = "0.0.1" dependencies = [ "clap", "criterion", diff --git a/examples/rust/crates/bar/src/lib.rs b/examples/rust/crates/bar/src/lib.rs index 42007e0c9..b814969bd 100644 --- a/examples/rust/crates/bar/src/lib.rs +++ b/examples/rust/crates/bar/src/lib.rs @@ -1,6 +1,7 @@ //! This is the bar crate /// Adds two numbers +#[must_use] pub fn add(left: usize, right: usize) -> usize { left + right }