File tree Expand file tree Collapse file tree 9 files changed +13
-8
lines changed Expand file tree Collapse file tree 9 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 1+ [alias ]
2+ # Temporary solution to have clippy config in a single place until https://github.com/rust-lang/rust-clippy/blob/master/doc/roadmap-2021.md#lintstoml-configuration is shipped.
3+ custom-clippy = " clippy -- -A clippy::type_complexity -A clippy::pedantic -A clippy::style -D warnings"
Original file line number Diff line number Diff line change @@ -152,8 +152,7 @@ jobs:
152152 - name : Run cargo clippy
153153 uses :
actions-rs/[email protected] 154154 with :
155- command : clippy
156- args : -- -A clippy::type_complexity -A clippy::pedantic -A clippy::style
155+ command : custom-clippy # cargo alias to allow reuse of config locally
157156
158157 integration-test :
159158 name : Integration tests
Original file line number Diff line number Diff line change @@ -756,6 +756,7 @@ impl NetworkBehaviour for Relay {
756756}
757757
758758#[ derive( Debug ) ]
759+ #[ allow( clippy:: large_enum_variant) ]
759760pub enum BehaviourToListenerMsg {
760761 ConnectionToRelayEstablished ,
761762 IncomingRelayedConnection {
Original file line number Diff line number Diff line change @@ -733,6 +733,7 @@ impl ProtocolsHandler for RelayHandler {
733733 }
734734}
735735
736+ #[ allow( clippy:: large_enum_variant) ]
736737pub enum RelayOutboundOpenInfo {
737738 Relay {
738739 dst_peer_id : PeerId ,
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ impl upgrade::InboundUpgrade<NegotiatedSubstream> for RelayListen {
7676 let msg: bytes:: BytesMut = substream
7777 . next ( )
7878 . await
79- . ok_or ( std:: io:: Error :: new ( std:: io:: ErrorKind :: UnexpectedEof , "" ) ) ??;
79+ . ok_or_else ( || std:: io:: Error :: new ( std:: io:: ErrorKind :: UnexpectedEof , "" ) ) ??;
8080 let CircuitRelay {
8181 r#type,
8282 src_peer,
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ impl upgrade::OutboundUpgrade<NegotiatedSubstream> for OutgoingDstReq {
100100 substream
101101 . next ( )
102102 . await
103- . ok_or ( OutgoingDstReqError :: Io ( std:: io:: Error :: new (
103+ . ok_or_else ( || OutgoingDstReqError :: Io ( std:: io:: Error :: new (
104104 std:: io:: ErrorKind :: UnexpectedEof ,
105105 "" ,
106106 ) ) ) ??;
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ impl upgrade::OutboundUpgrade<NegotiatedSubstream> for OutgoingRelayReq {
8787 } ) ,
8888 dst_peer : Some ( circuit_relay:: Peer {
8989 id : dst_id. to_bytes ( ) ,
90- addrs : vec ! [ dst_address. unwrap_or ( Multiaddr :: empty( ) ) . to_vec( ) ] ,
90+ addrs : vec ! [ dst_address. unwrap_or_else ( Multiaddr :: empty) . to_vec( ) ] ,
9191 } ) ,
9292 code : None ,
9393 } ;
@@ -107,7 +107,7 @@ impl upgrade::OutboundUpgrade<NegotiatedSubstream> for OutgoingRelayReq {
107107 substream
108108 . next ( )
109109 . await
110- . ok_or ( OutgoingRelayReqError :: Io ( std:: io:: Error :: new (
110+ . ok_or_else ( || OutgoingRelayReqError :: Io ( std:: io:: Error :: new (
111111 std:: io:: ErrorKind :: UnexpectedEof ,
112112 "" ,
113113 ) ) ) ??;
Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ impl<T: Transport + Clone> Transport for RelayTransport<T> {
198198 } ;
199199
200200 let ( to_listener, from_behaviour) = mpsc:: channel ( 0 ) ;
201- let mut to_behaviour = self . to_behaviour . clone ( ) ;
201+ let mut to_behaviour = self . to_behaviour ;
202202 let msg_to_behaviour = Some (
203203 async move {
204204 to_behaviour
@@ -242,7 +242,7 @@ impl<T: Transport + Clone> Transport for RelayTransport<T> {
242242 let relay_addr = relay_addr. ok_or ( RelayError :: MissingRelayAddr ) ?;
243243 let dst_peer_id = dst_peer_id. ok_or ( RelayError :: MissingDstPeerId ) ?;
244244
245- let mut to_behaviour = self . to_behaviour . clone ( ) ;
245+ let mut to_behaviour = self . to_behaviour ;
246246 Ok ( EitherFuture :: Second (
247247 async move {
248248 let ( tx, rx) = oneshot:: channel ( ) ;
Original file line number Diff line number Diff line change @@ -330,6 +330,7 @@ where
330330
331331/// The possible errors of a [`GenDnsConfig`] wrapped transport.
332332#[ derive( Debug ) ]
333+ #[ allow( clippy:: large_enum_variant) ]
333334pub enum DnsErr < TErr > {
334335 /// The underlying transport encountered an error.
335336 Transport ( TErr ) ,
You can’t perform that action at this time.
0 commit comments