Chore: Apply latest nightly clippy lints

This commit is contained in:
Kyle Simpson
2023-01-09 00:43:53 +00:00
parent c60c454cf5
commit 125c803fa7
9 changed files with 21 additions and 31 deletions

View File

@@ -234,7 +234,7 @@ impl Read for AsyncAdapterStream {
std::thread::yield_now();
},
a => {
println!("Misc err {:?}", a);
println!("Misc err {a:?}");
return a;
},
}

View File

@@ -27,10 +27,10 @@ pub enum Error {
impl Display for Error {
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
match self {
Self::Create(c) => f.write_fmt(format_args!("failed to create audio stream: {}", c)),
Self::Create(c) => f.write_fmt(format_args!("failed to create audio stream: {c}")),
Self::CreatePanicked => f.write_str("sync thread panicked while creating stream"),
Self::Streamcatcher(s) =>
f.write_fmt(format_args!("illegal streamcatcher config: {}", s)),
f.write_fmt(format_args!("illegal streamcatcher config: {s}")),
Self::StreamNotAtStart =>
f.write_str("stream cannot have been pre-read/parsed, missing headers"),
}
@@ -87,9 +87,9 @@ pub enum CodecCacheError {
impl Display for CodecCacheError {
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
match self {
Self::Create(c) => f.write_fmt(format_args!("failed to create audio stream: {}", c)),
Self::Parse(p) => f.write_fmt(format_args!("failed to parse audio format: {}", p)),
Self::Opus(o) => f.write_fmt(format_args!("failed to create Opus encoder: {}", o)),
Self::Create(c) => f.write_fmt(format_args!("failed to create audio stream: {c}")),
Self::Parse(p) => f.write_fmt(format_args!("failed to parse audio format: {p}")),
Self::Opus(o) => f.write_fmt(format_args!("failed to create Opus encoder: {o}")),
Self::MetadataEncoding(m) => f.write_fmt(format_args!(
"failed to convert track metadata to JSON: {}",
m
@@ -99,7 +99,7 @@ impl Display for CodecCacheError {
Self::UnknownChannelCount =>
f.write_str("audio stream's channel count could not be determined"),
Self::Streamcatcher(s) =>
f.write_fmt(format_args!("illegal streamcatcher config: {}", s)),
f.write_fmt(format_args!("illegal streamcatcher config: {s}")),
Self::StreamNotAtStart =>
f.write_str("stream cannot have been pre-read/parsed, missing headers"),
}

View File

@@ -25,7 +25,7 @@ impl Display for AudioStreamError {
f.write_str("failed to create audio: ")?;
match self {
Self::RetryIn(t) => f.write_fmt(format_args!("retry in {:.2}s", t.as_secs_f32())),
Self::Fail(why) => f.write_fmt(format_args!("{}", why)),
Self::Fail(why) => f.write_fmt(format_args!("{why}")),
Self::Unsupported => f.write_str("operation was not supported"),
}
}
@@ -150,8 +150,7 @@ impl Display for AuxMetadataError {
f.write_str("failed to get aux_metadata: ")?;
match self {
Self::NoCompose => f.write_str("the input has no Compose object"),
Self::Retrieve(e) =>
f.write_fmt(format_args!("aux_metadata error from Compose: {}", e)),
Self::Retrieve(e) => f.write_fmt(format_args!("aux_metadata error from Compose: {e}")),
}
}
}

View File

@@ -66,7 +66,7 @@ impl HttpRequest {
match (offset, self.content_length) {
(Some(offset), None) => {
resp = resp.header(RANGE, format!("bytes={}-", offset));
resp = resp.header(RANGE, format!("bytes={offset}-"));
},
(offset, Some(max)) => {
resp = resp.header(