Skip to content

Commit

Permalink
fix: clippy for rust 1.59.0 (#162)
Browse files Browse the repository at this point in the history
* fix: clippy for rust `1.59.0`

* add 2 new versions of Rust

* update build with `actions-rs/toolchain`

* bump: `1.3.0`
  • Loading branch information
afonsojramos authored Feb 25, 2022
1 parent def813e commit 3df0571
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ jobs:
name: Build
strategy:
matrix:
rust-version: ["1.55", "1.56", "1.57"]
rust-version: ["1.54", "stable"]
runs-on: ubuntu-latest
container: rust:${{ matrix.rust-version }}
steps:
- name: Repository Checkout
uses: actions/checkout@v2

- name: Install Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust-version }}
profile: minimal
override: true

- name: Cache
uses: Swatinem/rust-cache@v1

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "parrot"
version = "1.2.1"
version = "1.3.0"
authors = ["aquelemiguel"]
edition = "2018"
description = "A Discord music bot built in Rust"
Expand Down
6 changes: 2 additions & 4 deletions src/commands/seek.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ pub async fn seek(
let (minutes, seconds) = (
units_iter
.next()
.map(|token| token.parse::<u64>().ok())
.flatten(),
.and_then(|token| token.parse::<u64>().ok()),
units_iter
.next()
.map(|token| token.parse::<u64>().ok())
.flatten(),
.and_then(|token| token.parse::<u64>().ok()),
);

if minutes.is_none() || seconds.is_none() {
Expand Down
2 changes: 1 addition & 1 deletion src/sources/youtube.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async fn _ytdl_metadata(uri: &str) -> SongbirdResult<Metadata> {
let end = (&o_vec)
.iter()
.position(|el| *el == NEWLINE_BYTE)
.unwrap_or_else(|| o_vec.len());
.unwrap_or(o_vec.len());

let value = serde_json::from_slice(&o_vec[..end]).map_err(|err| SongbirdError::Json {
error: err,
Expand Down

0 comments on commit 3df0571

Please sign in to comment.