From 485b546847f4bb86624c106609589943f41b9e16 Mon Sep 17 00:00:00 2001 From: Afonso Jorge Ramos Date: Fri, 25 Feb 2022 09:57:36 +0000 Subject: [PATCH 1/4] fix: clippy for rust `1.59.0` --- src/commands/seek.rs | 6 ++---- src/sources/youtube.rs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/commands/seek.rs b/src/commands/seek.rs index 2550866d..98d7e475 100644 --- a/src/commands/seek.rs +++ b/src/commands/seek.rs @@ -25,12 +25,10 @@ pub async fn seek( let (minutes, seconds) = ( units_iter .next() - .map(|token| token.parse::().ok()) - .flatten(), + .and_then(|token| token.parse::().ok()), units_iter .next() - .map(|token| token.parse::().ok()) - .flatten(), + .and_then(|token| token.parse::().ok()), ); if minutes.is_none() || seconds.is_none() { diff --git a/src/sources/youtube.rs b/src/sources/youtube.rs index 7beff58b..fef9217e 100644 --- a/src/sources/youtube.rs +++ b/src/sources/youtube.rs @@ -174,7 +174,7 @@ async fn _ytdl_metadata(uri: &str) -> SongbirdResult { 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, From 3e41edca180fc64f1924e45f417eacbf6b459e74 Mon Sep 17 00:00:00 2001 From: Afonso Jorge Ramos Date: Fri, 25 Feb 2022 10:03:45 +0000 Subject: [PATCH 2/4] add 2 new versions of Rust --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89adedd1..07a6a5a6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ jobs: name: Build strategy: matrix: - rust-version: ["1.55", "1.56", "1.57"] + rust-version: ["1.55", "1.56", "1.57", "1.58", "1.59"] runs-on: ubuntu-latest container: rust:${{ matrix.rust-version }} steps: From fd3027ae41732ea2963ac35ae600d59984799f0a Mon Sep 17 00:00:00 2001 From: Afonso Jorge Ramos Date: Fri, 25 Feb 2022 14:51:13 +0000 Subject: [PATCH 3/4] update build with `actions-rs/toolchain` --- .github/workflows/main.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 07a6a5a6..be7c8b79 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,13 +7,19 @@ jobs: name: Build strategy: matrix: - rust-version: ["1.55", "1.56", "1.57", "1.58", "1.59"] + 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 From 970b4ebe12c9f015ded4964ed3312f700c387064 Mon Sep 17 00:00:00 2001 From: Afonso Jorge Ramos Date: Fri, 25 Feb 2022 14:54:19 +0000 Subject: [PATCH 4/4] bump: `1.3.0` --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18241967..881b8d01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -836,7 +836,7 @@ dependencies = [ [[package]] name = "parrot" -version = "1.2.1" +version = "1.3.0" dependencies = [ "dotenv", "rand 0.8.4", diff --git a/Cargo.toml b/Cargo.toml index 9ec5e000..93751797 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"