File tree 2 files changed +4
-17
lines changed 2 files changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -10,30 +10,16 @@ pub type AuditProvider =
10
10
11
11
type AuditProviders = Vec < AuditProvider > ;
12
12
13
- static mut PROVIDERS : OnceLock < AuditProviders > = OnceLock :: new ( ) ;
13
+ static PROVIDERS : OnceLock < AuditProviders > = OnceLock :: new ( ) ;
14
14
15
15
/// Initialize audit trail providers.
16
16
pub fn init_providers ( providers : AuditProviders ) {
17
- unsafe {
18
- PROVIDERS . get_or_init ( || providers) ;
19
- }
20
- }
21
-
22
- /// Update audit trail providers.
23
- ///
24
- /// # Panics
25
- ///
26
- /// If the audit trail providers have not already been set.
27
- pub fn update_providers ( providers : AuditProviders ) {
28
- unsafe {
29
- let audit_providers = PROVIDERS . get_mut ( ) . unwrap ( ) ;
30
- * audit_providers = providers;
31
- }
17
+ PROVIDERS . get_or_init ( || providers) ;
32
18
}
33
19
34
20
/// Configured audit providers.
35
21
pub fn providers < ' a > ( ) -> Option < & ' a AuditProviders > {
36
- unsafe { PROVIDERS . get ( ) }
22
+ PROVIDERS . get ( )
37
23
}
38
24
39
25
/// Append audit events to all configured providers.
Original file line number Diff line number Diff line change 1
1
#![ deny( missing_docs) ]
2
+ #![ forbid( unsafe_code) ]
2
3
#![ cfg_attr( all( doc, CHANNEL_NIGHTLY ) , feature( doc_auto_cfg) ) ]
3
4
//! Backend database and file system storage.
4
5
mod access_point;
You can’t perform that action at this time.
0 commit comments