Why this matters
Proper async runtime and error propagation yield clearer failures.
For async code, annotate with #[tokio::test] (or async runtime in use) and return Result from tests; never use unwrap()/expect() in assertions.
Proper async runtime and error propagation yield clearer failures.
Side-by-side examples engineers can pattern-match during review.
#[test]
async fn computes(){
let v = maybe_async().await; // invalid in std test
assert!(v.unwrap() > 0);
}#[tokio::test]
async fn computes() -> Result<(), Box<dyn std::error::Error>> {
let v = maybe_async().await?;
assert!(v > 0);
Ok(())
}#[tokio::test]
async fn x()->Result<(),Box<dyn std::error::Error>>{ Ok(()) }assert_eq!(some_result.unwrap(), 3)From the same buckets as this rule.
Reject PRs adding real PAN/CVV in fixtures, seeds, or mocks. Only use Luhn-valid test PANs from the gateway or opaque tokens (e.g., tok_) and never include CVV. Add a check to fail if a PAN regex is matched. (PCI DSS data minimization)