Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
napalmpapalam committed May 18, 2024
1 parent 9bf20fd commit e990518
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Build and Lint
on: [push]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# Make sure CI fails on all warnings, including Clippy lints
env:
RUSTFLAGS: "-D warnings"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
tags:
- '*.*.*'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
Expand All @@ -18,6 +22,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Rustfmt
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features
- name: Build
Expand Down
6 changes: 5 additions & 1 deletion src/changelog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ impl Changelog {
}

pub fn save_to_file(&self, path: &str) -> Result<()> {
let mut file = OpenOptions::new().write(true).create(true).open(path)?;
let mut file = OpenOptions::new()
.write(true)
.create(true)
.truncate(true)
.open(path)?;
file.write_all(self.to_string().as_bytes())?;
file.flush()?;
Ok(())
Expand Down

0 comments on commit e990518

Please sign in to comment.