1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-06 03:50:06 +02:00

Fix newly reported clippy errors

- Use variables directly in format strings.
  As reported by clippy, variables can be used directly in the
  `format!` string.
- Use rewind() instead of seeking to 0.
- Remove superfluous & and ref.

Signed-off-by: Petr Tesarik <petr@tesarici.cz>
This commit is contained in:
Petr Tesarik 2023-01-27 23:15:51 +01:00
parent e9dbdfed25
commit c600297f52
19 changed files with 69 additions and 90 deletions

View file

@ -62,7 +62,7 @@ async fn receive_data(
Some(Err(e)) => break Err(e.into()),
None => {
if actual_length != request.length {
let msg = format!("did not expect body to contain {} bytes", actual_length);
let msg = format!("did not expect body to contain {actual_length} bytes");
break Err(Error::data_loss(msg));
}
@ -385,7 +385,7 @@ impl AudioFileFetch {
let complete_tx = self.complete_tx.take();
if let Some(mut output) = output {
output.seek(SeekFrom::Start(0))?;
output.rewind()?;
if let Some(complete_tx) = complete_tx {
complete_tx
.send(output)