Description
New module stubs added for issues 96–185 were created with skeleton function signatures that the compiler flags as dead code. Once a module is implemented, all #[allow(dead_code)] and #[allow(unused)] suppressions should be removed. This chore performs a full audit, removes all suppression attributes, fixes any resulting warnings, and ensures cargo clippy -- -D warnings passes with zero warnings.
Files to Modify
- Every
.rs file in contracts/stellar-grants/src/ that contains #[allow(dead_code)] or #[allow(unused)]
Technical Requirements
Audit steps:
- Run:
grep -rn "allow(dead_code)\|allow(unused)" src/
- For each occurrence, determine if the suppression is still needed:
- If the code is now called → remove the
#[allow].
- If the code is genuinely unused but intentionally public API → keep but document why.
- If the code is truly dead → delete the dead code.
- Run
cargo clippy -- -D warnings after each batch of removals.
Common patterns to clean up:
// REMOVE if function is now called:
#[allow(dead_code)]
pub fn some_function() { ... }
// REMOVE if struct field is now used:
#[allow(dead_code)]
pub unused_field: u32,
// KEEP with comment if intentionally part of public ABI:
/// Reserved for future use in protocol v3 upgrade path.
#[allow(dead_code)]
pub fn future_hook() { ... }
Clippy lints to resolve:
clippy::needless_return — remove explicit return at end of function.
clippy::redundant_clone — remove unnecessary .clone().
clippy::match_like_matches_macro — simplify match-bool patterns.
clippy::unnecessary_unwrap — replace .unwrap() with ? where applicable.
Acceptance Criteria
Estimated Effort
Beginner: 2-4 hours
Description
New module stubs added for issues 96–185 were created with skeleton function signatures that the compiler flags as dead code. Once a module is implemented, all
#[allow(dead_code)]and#[allow(unused)]suppressions should be removed. This chore performs a full audit, removes all suppression attributes, fixes any resulting warnings, and ensurescargo clippy -- -D warningspasses with zero warnings.Files to Modify
.rsfile incontracts/stellar-grants/src/that contains#[allow(dead_code)]or#[allow(unused)]Technical Requirements
Audit steps:
grep -rn "allow(dead_code)\|allow(unused)" src/#[allow].cargo clippy -- -D warningsafter each batch of removals.Common patterns to clean up:
Clippy lints to resolve:
clippy::needless_return— remove explicitreturnat end of function.clippy::redundant_clone— remove unnecessary.clone().clippy::match_like_matches_macro— simplify match-bool patterns.clippy::unnecessary_unwrap— replace.unwrap()with?where applicable.Acceptance Criteria
cargo clippy -- -D warningspasses with zero warnings.#[allow(dead_code)]suppressions either removed or justified with a comment.Estimated Effort
Beginner: 2-4 hours