Merge pull request #1270 from yubiuser/fix/clippy

Fix clippy warnings
This commit is contained in:
Roderick van Domburg 2024-05-11 12:34:05 +02:00 committed by GitHub
commit a5964c28fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 10 additions and 38 deletions

View file

@ -1,5 +1,4 @@
use std::{ use std::{
convert::TryFrom,
future::Future, future::Future,
pin::Pin, pin::Pin,
sync::atomic::{AtomicUsize, Ordering}, sync::atomic::{AtomicUsize, Ordering},
@ -9,7 +8,7 @@ use std::{
use futures_util::{stream::FusedStream, FutureExt, StreamExt}; use futures_util::{stream::FusedStream, FutureExt, StreamExt};
use protobuf::{self, Message}; use protobuf::Message;
use rand::prelude::SliceRandom; use rand::prelude::SliceRandom;
use thiserror::Error; use thiserror::Error;
use tokio::sync::mpsc; use tokio::sync::mpsc;

View file

@ -1,7 +1,4 @@
use std::{ use std::ops::{Deref, DerefMut};
convert::TryFrom,
ops::{Deref, DerefMut},
};
use protobuf::Message; use protobuf::Message;
use thiserror::Error; use thiserror::Error;

View file

@ -2,7 +2,7 @@ use std::{env::consts::ARCH, io};
use byteorder::{BigEndian, ByteOrder, WriteBytesExt}; use byteorder::{BigEndian, ByteOrder, WriteBytesExt};
use hmac::{Hmac, Mac}; use hmac::{Hmac, Mac};
use protobuf::{self, Message}; use protobuf::Message;
use rand::{thread_rng, RngCore}; use rand::{thread_rng, RngCore};
use rsa::{BigUint, Pkcs1v15Sign, RsaPublicKey}; use rsa::{BigUint, Pkcs1v15Sign, RsaPublicKey};
use sha1::{Digest, Sha1}; use sha1::{Digest, Sha1};

View file

@ -7,7 +7,7 @@ use std::io;
use futures_util::{SinkExt, StreamExt}; use futures_util::{SinkExt, StreamExt};
use num_traits::FromPrimitive; use num_traits::FromPrimitive;
use protobuf::{self, Message}; use protobuf::Message;
use thiserror::Error; use thiserror::Error;
use tokio::net::TcpStream; use tokio::net::TcpStream;
use tokio_util::codec::Framed; use tokio_util::codec::Framed;

View file

@ -1,4 +1,4 @@
use std::{convert::TryFrom, fmt::Debug, ops::Deref}; use std::{fmt::Debug, ops::Deref};
use time::{ use time::{
error::ComponentRange, format_description::well_known::Iso8601, Date as _Date, OffsetDateTime, error::ComponentRange, format_description::well_known::Iso8601, Date as _Date, OffsetDateTime,

View file

@ -513,13 +513,7 @@ impl Session {
} }
pub fn get_user_attribute(&self, key: &str) -> Option<String> { pub fn get_user_attribute(&self, key: &str) -> Option<String> {
self.0 self.0.data.read().user_data.attributes.get(key).cloned()
.data
.read()
.user_data
.attributes
.get(key)
.map(Clone::clone)
} }
fn weak(&self) -> SessionWeak { fn weak(&self) -> SessionWeak {

View file

@ -1,8 +1,4 @@
use std::{ use std::{fmt, ops::Deref};
convert::{TryFrom, TryInto},
fmt,
ops::Deref,
};
use thiserror::Error; use thiserror::Error;

View file

@ -1,5 +1,4 @@
use std::{ use std::{
convert::{TryFrom, TryInto},
fmt::Debug, fmt::Debug,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
}; };

View file

@ -1,5 +1,4 @@
use std::{ use std::{
convert::{TryFrom, TryInto},
fmt::Debug, fmt::Debug,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
}; };

View file

@ -1,5 +1,4 @@
use std::{ use std::{
convert::TryFrom,
fmt::Debug, fmt::Debug,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
}; };

View file

@ -1,5 +1,4 @@
use std::{ use std::{
convert::{TryFrom, TryInto},
fmt::Debug, fmt::Debug,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
}; };

View file

@ -1,5 +1,4 @@
use std::{ use std::{
convert::{TryFrom, TryInto},
fmt::Debug, fmt::Debug,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
}; };

View file

@ -1,4 +1,3 @@
use std::convert::TryFrom;
use std::fmt::Debug; use std::fmt::Debug;
use protobuf::Message; use protobuf::Message;

View file

@ -1,6 +1,5 @@
use std::{ use std::{
collections::HashMap, collections::HashMap,
convert::TryFrom,
fmt::Debug, fmt::Debug,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
}; };

View file

@ -1,4 +1,4 @@
use std::{convert::TryFrom, fmt::Debug}; use std::fmt::Debug;
use super::operation::PlaylistOperations; use super::operation::PlaylistOperations;

View file

@ -1,5 +1,4 @@
use std::{ use std::{
convert::{TryFrom, TryInto},
fmt::Debug, fmt::Debug,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
}; };

View file

@ -1,5 +1,4 @@
use std::{ use std::{
convert::{TryFrom, TryInto},
fmt::Debug, fmt::Debug,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
}; };

View file

@ -1,5 +1,4 @@
use std::{ use std::{
convert::TryFrom,
fmt::Debug, fmt::Debug,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
}; };

View file

@ -1,5 +1,4 @@
use std::{ use std::{
convert::TryFrom,
fmt::Debug, fmt::Debug,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
}; };

View file

@ -1,7 +1,4 @@
use std::{ use std::fmt::Debug;
convert::{TryFrom, TryInto},
fmt::Debug,
};
use crate::{ use crate::{
availability::Availabilities, copyright::Copyrights, episode::Episodes, image::Images, availability::Availabilities, copyright::Copyrights, episode::Episodes, image::Images,

View file

@ -1,5 +1,4 @@
use std::{ use std::{
convert::{TryFrom, TryInto},
fmt::Debug, fmt::Debug,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
}; };

View file

@ -66,6 +66,7 @@ impl Sink for StdoutSink {
OpenOptions::new() OpenOptions::new()
.write(true) .write(true)
.create(true) .create(true)
.truncate(true)
.open(file) .open(file)
.map_err(|e| StdoutError::OpenFailure { .map_err(|e| StdoutError::OpenFailure {
file: file.to_string(), file: file.to_string(),