Skip to content

Commit 2045ed7

Browse files
committed
Cargo clippy
1 parent c2244e3 commit 2045ed7

File tree

6 files changed

+7
-12
lines changed

6 files changed

+7
-12
lines changed

src/driver/tasks/mixer/mix_logic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ pub fn mix_symph_indiv(
246246
resample_in_progress = true;
247247
continue;
248248
}
249-
};
249+
}
250250

251251
let samples_marched = mix_resampled(rs_out_buf, symph_mix, samples_written, volume);
252252

src/input/adapters/cached/compressed.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ where
434434
},
435435
Err(e) => {
436436
debug!("Read error {:?} {:?} {:?}.", e, out, raw_len);
437-
out = Some(Err(IoError::new(IoErrorKind::Other, e)));
437+
out = Some(Err(IoError::other(e)));
438438
break;
439439
},
440440
}
@@ -472,7 +472,7 @@ where
472472

473473
// NOTE: use of raw_len here preserves true sample length even if
474474
// stream is extended to 20ms boundary.
475-
out.unwrap_or_else(|| Err(IoError::new(IoErrorKind::Other, "Unclear.")))
475+
out.unwrap_or_else(|| Err(IoError::other("Unclear.")))
476476
.map(|compressed_sz| {
477477
self.audio_bytes
478478
.fetch_add(raw_len * mem::size_of::<f32>(), Ordering::Release);

src/input/sources/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl HttpRequest {
133133

134134
let stream = Box::new(StreamReader::new(
135135
resp.bytes_stream()
136-
.map_err(|e| IoError::new(IoErrorKind::Other, e)),
136+
.map_err(|e| IoError::other(e)),
137137
));
138138

139139
let input = HttpStream {

src/input/sources/ytdl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl<'a> YoutubeDl<'a> {
167167
let out = output
168168
.stdout
169169
.split(|&b| b == b'\n')
170-
.filter(|&x| (!x.is_empty()))
170+
.filter(|&x| !x.is_empty())
171171
.map(serde_json::from_slice)
172172
.collect::<Result<Vec<Output>, _>>()
173173
.map_err(|e| AudioStreamError::Fail(Box::new(e)))?;

src/shards.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ use futures::channel::mpsc::{TrySendError, UnboundedSender as Sender};
1010
#[cfg(feature = "serenity")]
1111
use parking_lot::{lock_api::RwLockWriteGuard, Mutex as PMutex, RwLock as PRwLock};
1212
#[cfg(feature = "serenity")]
13-
use serde_json::json;
14-
#[cfg(feature = "serenity")]
1513
use serenity::gateway::ShardRunnerMessage;
1614
#[cfg(feature = "serenity")]
1715
use std::result::Result as StdResult;

src/tracks/ready.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/// Whether this track has been made live, is being processed, or is
22
/// currently uninitialised.
33
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
4+
#[derive(Default)]
45
pub enum ReadyState {
56
/// This track is still a lazy [`Compose`] object, and hasn't been made playable.
67
///
78
/// [`Compose`]: crate::input::Compose
9+
#[default]
810
Uninitialised,
911

1012
/// The mixer is currently creating and parsing this track's bytestream.
@@ -14,8 +16,3 @@ pub enum ReadyState {
1416
Playable,
1517
}
1618

17-
impl Default for ReadyState {
18-
fn default() -> Self {
19-
Self::Uninitialised
20-
}
21-
}

0 commit comments

Comments
 (0)