Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clippy for rust 1.59.0 #162

Merged
merged 4 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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