1- #[ allow( unused) ]
1+ #![ allow( unused) ]
2+
23use std:: cell:: { Cell , UnsafeCell } ;
34use std:: iter;
4- #[ allow( unused) ]
5- use std:: sync:: { Arc , Mutex , RwLock , RwLockReadGuard , RwLockWriteGuard , TryLockError } ;
6- #[ allow( unused) ]
5+ use std:: sync:: atomic:: { AtomicBool , Ordering } ;
6+ use std:: sync:: { Arc , Mutex , RwLock , TryLockError } ;
77use std:: thread;
88use std:: time:: Duration ;
99
1010#[ cfg( feature = "with_client_implementation" ) ]
1111use fragile:: SemiSticky ;
1212
13- #[ allow( unused) ]
14- use std:: sync:: atomic:: { AtomicBool , Ordering } ;
15-
1613#[ cfg( feature = "with_client_implementation" ) ]
1714use client:: Client ;
1815use protocol:: { Breadcrumb , Event , Level } ;
1916use scope:: { Scope , ScopeGuard } ;
20-
21- #[ cfg( feature = "with_client_implementation" ) ]
22- use utils:: current_thread;
23-
2417#[ cfg( feature = "with_client_implementation" ) ]
2518use scope:: { Stack , StackLayerToken } ;
19+ #[ cfg( feature = "with_client_implementation" ) ]
20+ use utils:: current_thread;
2621
2722use uuid:: Uuid ;
2823
@@ -53,7 +48,7 @@ impl IntoBreadcrumbs for Breadcrumb {
5348 type Output = iter:: Once < Breadcrumb > ;
5449
5550 fn into_breadcrumbs ( self ) -> Self :: Output {
56- return iter:: once ( self ) ;
51+ iter:: once ( self )
5752 }
5853}
5954
@@ -94,6 +89,7 @@ pub(crate) enum PendingProcessor {
9489
9590#[ cfg( feature = "with_client_implementation" ) ]
9691impl < F : ' static + FnOnce ( ) -> Box < Fn ( & mut Event ) + Send + Sync > > EventProcessorFactoryFn for F {
92+ #[ cfg_attr( feature = "cargo-clippy" , allow( boxed_local) ) ]
9793 fn call ( self : Box < Self > ) -> Box < Fn ( & mut Event ) + Send + Sync > {
9894 let this: Self = * self ;
9995 this ( )
@@ -254,7 +250,6 @@ impl Hub {
254250 /// This is useful for integrations that want to do efficiently nothing if there is no
255251 /// client bound. Additionally this internally ensures that the client can be safely
256252 /// synchronized. This prevents accidental recursive calls into the client.
257- #[ allow( unused_variables) ]
258253 pub fn with_active < F , R > ( f : F ) -> R
259254 where
260255 F : FnOnce ( & Arc < Hub > ) -> R ,
@@ -273,6 +268,7 @@ impl Hub {
273268
274269 /// Binds a hub to the current thread for the duration of the call.
275270 #[ cfg( feature = "with_client_implementation" ) ]
271+ #[ cfg_attr( feature = "cargo-clippy" , allow( needless_pass_by_value) ) ]
276272 pub fn run < F : FnOnce ( ) -> R , R > ( hub : Arc < Hub > , f : F ) -> R {
277273 hub. flush_pending_processors ( ) ;
278274 let mut restore_process_hub = false ;
@@ -305,7 +301,7 @@ impl Hub {
305301 // this is for the case where we just switched the hub. This
306302 // means we need to catch the panic, restore the
307303 // old context and resume the panic if needed.
308- let rv = panic:: catch_unwind ( panic:: AssertUnwindSafe ( || f ( ) ) ) ;
304+ let rv = panic:: catch_unwind ( panic:: AssertUnwindSafe ( f ) ) ;
309305 THREAD_HUB . with ( |ctx| unsafe { * ctx. get ( ) = old_hub } ) ;
310306 if restore_process_hub {
311307 USE_PROCESS_HUB . with ( |x| x. set ( true ) ) ;
@@ -321,7 +317,6 @@ impl Hub {
321317 /// Sends the event to the current client with the current scope.
322318 ///
323319 /// In case no client is bound this does nothing instead.
324- #[ allow( unused_variables) ]
325320 pub fn capture_event ( & self , event : Event < ' static > ) -> Uuid {
326321 self . flush_pending_processors ( ) ;
327322 with_client_impl ! { {
@@ -337,7 +332,6 @@ impl Hub {
337332 }
338333
339334 /// Captures an arbitrary message.
340- #[ allow( unused_variables) ]
341335 pub fn capture_message ( & self , msg : & str , level : Level ) -> Uuid {
342336 self . flush_pending_processors ( ) ;
343337 with_client_impl ! { {
@@ -364,7 +358,6 @@ impl Hub {
364358 }
365359
366360 /// Drains the currently pending events.
367- #[ allow( unused_variables) ]
368361 pub fn drain_events ( & self , timeout : Option < Duration > ) {
369362 with_client_impl ! { {
370363 if let Some ( ref client) = self . client( ) {
@@ -407,7 +400,6 @@ impl Hub {
407400 }
408401
409402 /// Invokes a function that can modify the current scope.
410- #[ allow( unused_variables) ]
411403 pub fn configure_scope < F , R > ( & self , f : F ) -> R
412404 where
413405 R : Default ,
@@ -428,7 +420,6 @@ impl Hub {
428420 ///
429421 /// This is equivalent to the global [`sentry::add_breadcrumb`](fn.add_breadcrumb.html) but
430422 /// sends the breadcrumb into the hub instead.
431- #[ allow( unused_variables) ]
432423 pub fn add_breadcrumb < B : IntoBreadcrumbs > ( & self , breadcrumb : B ) {
433424 with_client_impl ! { {
434425 self . inner. with_mut( |stack| {
@@ -522,7 +513,7 @@ impl Hub {
522513 self . inner. has_pending_processors. store( any_left, Ordering :: Release ) ;
523514 if !new_processors. is_empty( ) {
524515 self . configure_scope( |scope| {
525- for func in new_processors. into_iter ( ) {
516+ for func in new_processors {
526517 scope. event_processors = scope. event_processors. push_back( func) ;
527518 }
528519 } ) ;
0 commit comments