提交 09cd482d authored 作者: Nazar Mokrynskyi's avatar Nazar Mokrynskyi

Fix clippy suggestions from latest release

上级 e37dad53
......@@ -289,7 +289,7 @@ impl Default for DtlsRole {
/// The hash function algorithm (as defined in the "Hash function Textual Names" registry initially
/// specified in [RFC 4572](https://tools.ietf.org/html/rfc4572#section-8) Section 8) and its
/// corresponding certificate fingerprint value.
#[derive(Copy, Clone, PartialOrd, PartialEq)]
#[derive(Copy, Clone, PartialOrd, Eq, PartialEq)]
pub enum DtlsFingerprint {
/// sha-1
Sha1 {
......@@ -748,7 +748,7 @@ impl DtlsFingerprint {
}
/// DTLS parameters.
#[derive(Debug, Clone, PartialOrd, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, PartialOrd, Eq, PartialEq, Deserialize, Serialize)]
pub struct DtlsParameters {
/// DTLS role.
pub role: DtlsRole,
......
......@@ -356,6 +356,7 @@ impl WeakPipeTransportPair {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
new_transport: Bag<Arc<dyn Fn(NewTransport<'_>) + Send + Sync>>,
new_rtp_observer: Bag<Arc<dyn Fn(NewRtpObserver<'_>) + Send + Sync>>,
......
......@@ -49,6 +49,7 @@ pub struct ActiveSpeakerObserverDominantSpeaker {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
dominant_speaker: Bag<
Arc<dyn Fn(&ActiveSpeakerObserverDominantSpeaker) + Send + Sync>,
......
......@@ -60,6 +60,7 @@ pub struct AudioLevelObserverVolume {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
volumes: Bag<Arc<dyn Fn(&[AudioLevelObserverVolume]) + Send + Sync>>,
silence: Bag<Arc<dyn Fn() + Send + Sync>>,
......
......@@ -104,7 +104,7 @@ impl ConsumerOptions {
}
}
#[derive(Debug, Clone, PartialOrd, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, PartialOrd, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
pub struct RtpStreamParams {
......@@ -125,7 +125,7 @@ pub struct RtpStreamParams {
pub rtc_payload_type: Option<u8>,
}
#[derive(Debug, Clone, PartialOrd, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, PartialOrd, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
pub struct RtpStream {
......@@ -133,7 +133,7 @@ pub struct RtpStream {
pub score: u8,
}
#[derive(Debug, Clone, PartialOrd, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, PartialOrd, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
pub struct RtpRtxParameters {
......@@ -347,6 +347,7 @@ enum PayloadNotification {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
rtp: Bag<Arc<dyn Fn(&[u8]) + Send + Sync>>,
pause: Bag<Arc<dyn Fn() + Send + Sync>>,
......
......@@ -125,7 +125,7 @@ impl DataConsumerOptions {
}
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
#[non_exhaustive]
......@@ -140,7 +140,7 @@ pub struct DataConsumerDump {
}
/// RTC statistics of the data consumer.
#[derive(Debug, Clone, PartialOrd, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, PartialOrd, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
#[allow(missing_docs)]
......@@ -182,6 +182,7 @@ enum PayloadNotification {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
message: Bag<Arc<dyn Fn(&WebRtcMessage<'_>) + Send + Sync>>,
sctp_send_buffer_full: Bag<Arc<dyn Fn() + Send + Sync>>,
......
......@@ -95,7 +95,7 @@ pub enum DataProducerType {
Direct,
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
#[non_exhaustive]
......@@ -108,7 +108,7 @@ pub struct DataProducerDump {
}
/// RTC statistics of the data producer.
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
#[allow(missing_docs)]
......@@ -122,6 +122,7 @@ pub struct DataProducerStat {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
transport_close: BagOnce<Box<dyn FnOnce() + Send>>,
close: BagOnce<Box<dyn FnOnce() + Send>>,
......
......@@ -49,7 +49,7 @@ impl Default for DirectTransportOptions {
}
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
#[non_exhaustive]
......@@ -110,6 +110,7 @@ pub struct DirectTransportStat {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
rtcp: Bag<Arc<dyn Fn(&[u8]) + Send + Sync>>,
new_producer: Bag<Arc<dyn Fn(&Producer) + Send + Sync>, Producer>,
......
......@@ -82,7 +82,7 @@ impl PipeTransportOptions {
}
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
#[non_exhaustive]
......@@ -161,6 +161,7 @@ pub struct PipeTransportRemoteParameters {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
new_producer: Bag<Arc<dyn Fn(&Producer) + Send + Sync>, Producer>,
new_consumer: Bag<Arc<dyn Fn(&Consumer) + Send + Sync>, Consumer>,
......
......@@ -98,7 +98,7 @@ impl PlainTransportOptions {
}
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
#[non_exhaustive]
......@@ -190,6 +190,7 @@ pub struct PlainTransportRemoteParameters {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
new_producer: Bag<Arc<dyn Fn(&Producer) + Send + Sync>, Producer>,
new_consumer: Bag<Arc<dyn Fn(&Consumer) + Send + Sync>, Consumer>,
......
......@@ -24,12 +24,10 @@ async fn init() -> Router {
.await
.expect("Failed to create worker");
let router = worker
worker
.create_router(RouterOptions::default())
.await
.expect("Failed to create router");
router
.expect("Failed to create router")
}
#[test]
......
......@@ -89,7 +89,7 @@ impl ProducerOptions {
}
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
pub struct RtpStreamRecv {
......@@ -278,6 +278,7 @@ enum Notification {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
score: Bag<Arc<dyn Fn(&[ProducerScore]) + Send + Sync>>,
video_orientation_change: Bag<Arc<dyn Fn(ProducerVideoOrientation) + Send + Sync>>,
......
......@@ -78,7 +78,7 @@ pub enum TransportTraceEventType {
Bwe,
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
pub struct RtpListener {
......@@ -101,7 +101,7 @@ pub struct RecvRtpHeaderExtensions {
transport_wide_cc01: Option<u8>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
pub struct SctpListener {
......
......@@ -183,7 +183,7 @@ impl WebRtcTransportOptions {
}
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
#[non_exhaustive]
......@@ -258,7 +258,7 @@ pub struct WebRtcTransportStat {
}
/// Remote parameters for [`WebRtcTransport`].
#[derive(Debug, Clone, PartialOrd, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, PartialOrd, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct WebRtcTransportRemoteParameters {
/// Remote DTLS parameters.
......@@ -266,6 +266,7 @@ pub struct WebRtcTransportRemoteParameters {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
new_producer: Bag<Arc<dyn Fn(&Producer) + Send + Sync>, Producer>,
new_consumer: Bag<Arc<dyn Fn(&Consumer) + Send + Sync>, Consumer>,
......
......@@ -59,7 +59,7 @@ pub struct WebRtcServerTupleHash {
pub webrtc_transport_id: TransportId,
}
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[doc(hidden)]
#[non_exhaustive]
......@@ -151,6 +151,7 @@ impl WebRtcServerOptions {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
new_webrtc_transport: BagOnce<Box<dyn Fn(&WebRtcTransport) + Send>>,
worker_close: BagOnce<Box<dyn FnOnce() + Send>>,
......
......@@ -274,6 +274,7 @@ pub enum CreateRouterError {
}
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
new_router: Bag<Arc<dyn Fn(&Router) + Send + Sync>, Router>,
new_webrtc_server: Bag<Arc<dyn Fn(&WebRtcServer) + Send + Sync>, WebRtcServer>,
......
......@@ -37,6 +37,7 @@ pub(super) enum InternalMessage {
Unexpected(Vec<u8>),
}
#[allow(clippy::type_complexity)]
pub(crate) struct BufferMessagesGuard {
target_id: SubscriptionTarget,
buffered_notifications_for: Arc<Mutex<HashedMap<SubscriptionTarget, Vec<Vec<u8>>>>>,
......@@ -158,6 +159,7 @@ struct OutgoingMessageBuffer {
messages: VecDeque<Arc<AtomicTake<Vec<u8>>>>,
}
#[allow(clippy::type_complexity)]
struct Inner {
outgoing_message_buffer: Arc<Mutex<OutgoingMessageBuffer>>,
internal_message_receiver: async_channel::Receiver<InternalMessage>,
......
......@@ -4,6 +4,7 @@ pub(super) use mediasoup_sys::{
use std::os::raw::c_void;
use std::slice;
#[allow(clippy::type_complexity)]
pub(super) struct ChannelReadCallback(Box<dyn FnMut(&[u8]) + Send + 'static>);
pub(crate) struct PreparedChannelWrite {
......@@ -59,6 +60,7 @@ where
}
}
#[allow(clippy::type_complexity)]
pub(super) struct PayloadChannelReadCallback(Box<dyn FnMut(&[u8], &[u8]) + Send + 'static>);
pub(crate) struct PreparedPayloadChannelWrite {
......
......@@ -17,6 +17,7 @@ use std::sync::Arc;
use std::{fmt, io, mem};
#[derive(Default)]
#[allow(clippy::type_complexity)]
struct Handlers {
new_worker: Bag<Arc<dyn Fn(&Worker) + Send + Sync>, Worker>,
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论