Fix `cargo fmt --check` failure that turns Contract CI red on main

Aperta Adatta ai principianti
#53 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
90/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions, rust
Ambito
ci-cd, tooling

Direzione di ricerca

L'unico file che deve essere modificato è contracts/invoice/src/lib.rs. Esegui cargo fmt --all da contracts/ e controlla il diff, che dovrebbe riguardare solo la firma di get_invoice_range, le righe vuote e l'espressione if let Some(inv) andata a capo. Il lavoro è completato quando cargo fmt --all --check passa, cargo clippy --all-targets e cargo test continuano a passare con i 23 test, e il diff non contiene modifiche alla logica.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug contract difficulty: beginner dx good first issue help wanted

Difficulty: Beginner

Problem

After PR #42 was merged, cargo fmt --all --check fails on main. rustfmt wants the get_invoice_range signature on one line, wants two whitespace-only lines inside it emptied, and wants the long if let Some(inv) = env.storage()... expression wrapped. Contract CI fails at its first step (format check), so clippy, tests and the wasm build never run.

Why it matters

A red Contract CI hides real regressions and blocks every future contract PR from showing a meaningful status.

Scope of work

Run cargo fmt --all in contracts/ and commit the result. No behaviour change. Only contracts/invoice/src/lib.rs should change (about 15 lines).

Acceptance criteria

  • cargo fmt --all --check passes.
  • cargo clippy --all-targets and cargo test still pass (23 tests).
  • Contract CI is green on the PR.
  • The diff contains formatting changes only.

Relevant files

  • contracts/invoice/src/lib.rs

Dependencies

None.

Maintainer discussion needed?

No. Urgent, because CI is currently red.

Lingua principale
TypeScript
Stelle
0
Fork
4
Merge medio
54m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Yormee-103/PayLoop

Tutte le issue di Yormee-103/PayLoop

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.