Skip to content

Commit

Permalink
Merge pull request #144 from sr-gi/clippy-fixes
Browse files Browse the repository at this point in the history
sim-lib: Fixes clippy issues
  • Loading branch information
carlaKC authored Oct 20, 2023
2 parents ff9f918 + 72ea38e commit 3570988
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
42 changes: 15 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,25 @@ jobs:
name: Check code formatting
runs-on: ubuntu-latest
steps:
- name: Install protoc
run: sudo apt install -y protobuf-compiler
- uses: actions/checkout@v3
- uses: actions-rs/cargo@v1
name: cargo fmt
with:
command: fmt
args: --check
- uses: actions-rs/cargo@v1
name: cargo clippy
with:
command: clippy
args: -- --deny warnings
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-review'
github_token: ${{ secrets.GITHUB_TOKEN }}
clippy_flags: --all-features --all-targets --color always -- --deny warnings

build:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Install protoc
run: sudo apt install -y protobuf-compiler
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
name: cargo build
with:
command: build
args: --release --all-features
- uses: actions-rs/cargo@v1
name: cargo test
with:
command: test
args: --all-targets --benches
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: cargo build
run: cargo build --release --all-features
- name: cargo test
run: cargo test --all-features --all-targets --benches
2 changes: 1 addition & 1 deletion sim-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ impl Display for Payment {
write!(
f,
"Payment {} dispatched at {:?} sending {} msat from {} -> {}",
self.hash.map(|h| hex::encode(h.0)).unwrap_or(String::new()),
self.hash.map(|h| hex::encode(h.0)).unwrap_or_default(),
self.dispatch_time.duration_since(UNIX_EPOCH).unwrap(),
self.amount_msat,
self.source,
Expand Down

0 comments on commit 3570988

Please sign in to comment.