File tree Expand file tree Collapse file tree 8 files changed +15
-18
lines changed
io/zenoh-links/zenoh-link-quic/src Expand file tree Collapse file tree 8 files changed +15
-18
lines changed Original file line number Diff line number Diff line change 90
90
- name : Update Stable Rust toolchain
91
91
run : rustup update stable
92
92
93
+ - name : Make sure necessary tools are installed
94
+ run : rustup component add clippy rustfmt
95
+
93
96
- name : Setup rust-cache
94
97
uses : Swatinem/rust-cache@v2
95
98
with :
Original file line number Diff line number Diff line change @@ -407,8 +407,8 @@ impl io::Seek for ZBufReader<'_> {
407
407
. take ( self . cursor . slice )
408
408
. fold ( 0 , |acc, s| acc + s. len ( ) )
409
409
+ self . cursor . byte ;
410
- let current_pos = i64 :: try_from ( current_pos )
411
- . map_err ( |e| std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , e. to_string ( ) ) ) ?;
410
+ let current_pos =
411
+ i64 :: try_from ( current_pos ) . map_err ( |e| std:: io:: Error :: other ( e. to_string ( ) ) ) ?;
412
412
413
413
let offset = match pos {
414
414
std:: io:: SeekFrom :: Start ( s) => i64:: try_from ( s) . unwrap_or ( i64:: MAX ) - current_pos,
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ pub fn rustc_version_release(_tokens: TokenStream) -> TokenStream {
60
60
}
61
61
62
62
/// An enumeration of items which can be annotated with `#[zenoh_macros::unstable_doc]`, #[zenoh_macros::unstable]`, `#[zenoh_macros::internal]`
63
+ #[ allow( clippy:: large_enum_variant) ]
63
64
enum AnnotableItem {
64
65
/// Wrapper around [`syn::Item`].
65
66
Item ( Item ) ,
Original file line number Diff line number Diff line change @@ -23,18 +23,11 @@ pub type ConditionWaiter = Pin<Box<EventListener>>;
23
23
/// not be race condition on [notify_one](Condition::notify_one) or
24
24
/// [notify_all](Condition::notify_all).
25
25
///
26
+ #[ derive( Default ) ]
26
27
pub struct Condition {
27
28
event : Event ,
28
29
}
29
30
30
- impl Default for Condition {
31
- fn default ( ) -> Condition {
32
- Condition {
33
- event : Event :: new ( ) ,
34
- }
35
- }
36
- }
37
-
38
31
impl Condition {
39
32
/// Creates a new condition variable with a given capacity.
40
33
/// The capacity indicates the maximum number of tasks that
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ fn error_with_source() {
45
45
panic ! ( ) ;
46
46
}
47
47
48
- let ioerr = std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , "IOERR" ) ;
48
+ let ioerr = std:: io:: Error :: other ( "IOERR" ) ;
49
49
let e = zerror ! ( ioerr =>"ERR2" ) ;
50
50
let s = e. to_string ( ) ;
51
51
println ! ( "{e}" ) ;
Original file line number Diff line number Diff line change @@ -289,9 +289,8 @@ impl LinkManagerUnicastTrait for LinkManagerUnicastQuic {
289
289
290
290
let mut quic_endpoint = {
291
291
// create the Endpoint with this socket
292
- let runtime = quinn:: default_runtime ( ) . ok_or_else ( || {
293
- std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , "no async runtime found" )
294
- } ) ?;
292
+ let runtime = quinn:: default_runtime ( )
293
+ . ok_or_else ( || std:: io:: Error :: other ( "no async runtime found" ) ) ?;
295
294
ZResult :: Ok ( quinn:: Endpoint :: new_with_abstract_socket (
296
295
EndpointConfig :: default ( ) ,
297
296
None ,
@@ -410,9 +409,8 @@ impl LinkManagerUnicastTrait for LinkManagerUnicastQuic {
410
409
zenoh_util:: net:: set_bind_to_device_udp_socket ( & socket, iface) ?;
411
410
412
411
// create the Endpoint with this socket
413
- let runtime = quinn:: default_runtime ( ) . ok_or_else ( || {
414
- std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , "no async runtime found" )
415
- } ) ?;
412
+ let runtime = quinn:: default_runtime ( )
413
+ . ok_or_else ( || std:: io:: Error :: other ( "no async runtime found" ) ) ?;
416
414
ZResult :: Ok ( quinn:: Endpoint :: new_with_abstract_socket (
417
415
EndpointConfig :: default ( ) ,
418
416
Some ( server_config) ,
Original file line number Diff line number Diff line change @@ -130,6 +130,8 @@ impl Config {
130
130
// REVIEW(fuzzypixelz): the error variant of the Result is a Result because this does
131
131
// deserialization AND validation.
132
132
#[ zenoh_macros:: unstable]
133
+ // TODO(yellowhatter): clippy says that Error here is extremely large (1k)
134
+ #[ allow( clippy:: result_large_err) ]
133
135
pub fn from_deserializer < ' d , D : serde:: Deserializer < ' d > > (
134
136
d : D ,
135
137
) -> Result < Self , Result < Self , D :: Error > >
Original file line number Diff line number Diff line change @@ -1141,7 +1141,7 @@ impl Runtime {
1141
1141
tracing:: debug!( "Waiting for UDP datagram..." ) ;
1142
1142
loop {
1143
1143
let ( n, peer) = mcast_socket. recv_from ( & mut buf) . await . unwrap ( ) ;
1144
- if local_addrs. iter ( ) . any ( |addr| * addr == peer) {
1144
+ if local_addrs. contains ( & peer) {
1145
1145
tracing:: trace!( "Ignore UDP datagram from own socket" ) ;
1146
1146
continue ;
1147
1147
}
You can’t perform that action at this time.
0 commit comments