Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions earthly/rust/stdcfgs/cargo_manifest/project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ unchecked_duration_subtraction = "deny"
unreachable = "deny"
missing_docs_in_private_items = "deny"
arithmetic_side_effects = "deny"
use_debug = "deny"
disallowed-macros = "deny"
2 changes: 2 additions & 0 deletions earthly/rust/stdcfgs/cargo_manifest/workspace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ unchecked_duration_subtraction = "deny"
unreachable = "deny"
missing_docs_in_private_items = "deny"
arithmetic_side_effects = "deny"
use_debug = "deny"
disallowed-macros = "deny"
3 changes: 3 additions & 0 deletions earthly/rust/stdcfgs/clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ allow-unwrap-in-tests = true
allow-expect-in-tests = true
allow-panic-in-tests = true
arithmetic-side-effects-allowed = ["num_bigint::BigInt"]
disallowed-macros = [
{ path = "std::fmt::Debug", reason = "Debug Formatting not permitted in production release code.\nUse #[cfg_attr(debug_assertions, derive(Debug)] instead." },
]
2 changes: 2 additions & 0 deletions examples/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ unchecked_duration_subtraction = "deny"
unreachable = "deny"
missing_docs_in_private_items = "deny"
arithmetic_side_effects = "deny"
use_debug = "deny"
disallowed-macros = "deny"
3 changes: 3 additions & 0 deletions examples/rust/clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ allow-unwrap-in-tests = true
allow-expect-in-tests = true
allow-panic-in-tests = true
arithmetic-side-effects-allowed = ["num_bigint::BigInt"]
disallowed-macros = [
{ path = "std::fmt::Debug", reason = "Debug Formatting not permitted in production release code.\nUse #[cfg_attr(debug_assertions, derive(Debug)] instead." },
]
6 changes: 5 additions & 1 deletion examples/rust/crates/foo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use clap::Parser;
use foo::fmt_hello;

/// Simple program to greet a person
#[derive(Parser, Debug)]
#[cfg_attr(debug_assertions, derive(Debug))]
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
struct Args {
/// Name of the person to greet
Expand All @@ -21,6 +22,9 @@ struct Args {
fn main() {
let args = Args::parse();

#[cfg(debug_assertions)]
println!("{args:?}");

for cnt in 0..args.count {
println!("{}", fmt_hello(&args.name, cnt));
}
Expand Down
Loading