Skip to content

Commit

Permalink
Merge pull request #22 from triarius/github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
triarius authored Jul 22, 2023
2 parents 465af85 + 9f444e6 commit 15b9193
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on: [push, pull_request]
name: Clippy
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: cargo build --verbose
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: cargo test --verbose
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn passphrase(
});

(0..num_words)
.map(|i| (&words[i]).to_owned())
.map(|i| (words[i].to_owned()))
.collect::<Vec<String>>()
.join(separator)
}
2 changes: 1 addition & 1 deletion src/words.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(crate) fn words(path: Option<impl AsRef<Path>>) -> Vec<String> {
fn words_from_fixture() -> Vec<String> {
let bytes = include_bytes!("fixtures/words");
let string = String::from_utf8_lossy(bytes);
string.split("\n").map(|l| l.to_owned()).collect()
string.split('\n').map(|l| l.to_owned()).collect()
}

fn words_from_file(path: impl AsRef<Path>) -> Vec<String> {
Expand Down

0 comments on commit 15b9193

Please sign in to comment.