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

Đang mở Phù hợp với người mới
#53 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
90/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, rust
Lĩnh vực
ci-cd, tooling

Hướng nghiên cứu

Tệp duy nhất cần thay đổi là contracts/invoice/src/lib.rs. Chạy cargo fmt --all từ contracts/ và xem lại diff, diff này chỉ nên bao gồm chữ ký của get_invoice_range, các dòng trống và biểu thức if let Some(inv) đã được xuống dòng. Hoàn thành khi cargo fmt --all --check đạt, cargo clippy --all-targets và cargo test vẫn đạt với 23 bài kiểm thử, và diff không có thay đổi logic nào.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
0
Fork
4
Merge trung bình
54 phút
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Yormee-103/PayLoop

Tất cả issue của Yormee-103/PayLoop

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.