Commit 67ab0ce 1 parent cedaa4b commit 67ab0ce Copy full SHA for 67ab0ce
File tree 2 files changed +10
-10
lines changed
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -68,12 +68,12 @@ pub struct rustls_slice_slice_bytes<'a> {
68
68
/// returns 0.
69
69
#[ no_mangle]
70
70
pub extern "C" fn rustls_slice_slice_bytes_len ( input : * const rustls_slice_slice_bytes ) -> size_t {
71
- unsafe {
72
- match input. as_ref ( ) {
71
+
72
+ match unsafe { input. as_ref ( ) } {
73
73
Some ( c) => c. inner . len ( ) ,
74
74
None => 0 ,
75
75
}
76
- }
76
+
77
77
}
78
78
79
79
/// Retrieve the nth element from the input slice of slices. If the input
@@ -84,8 +84,8 @@ pub extern "C" fn rustls_slice_slice_bytes_get(
84
84
input : * const rustls_slice_slice_bytes ,
85
85
n : size_t ,
86
86
) -> rustls_slice_bytes {
87
- let input: & rustls_slice_slice_bytes = unsafe {
88
- match input. as_ref ( ) {
87
+ let input: & rustls_slice_slice_bytes = {
88
+ match unsafe { input. as_ref ( ) } {
89
89
Some ( c) => c,
90
90
None => {
91
91
return rustls_slice_bytes {
Original file line number Diff line number Diff line change @@ -98,26 +98,26 @@ impl SessionStoreBroker {
98
98
// See <https://github.com/rustls/rustls-ffi/pull/64#issuecomment-800766940>
99
99
let mut data: Vec < u8 > = vec ! [ 0 ; 65 * 1024 ] ;
100
100
let mut out_n: size_t = 0 ;
101
- unsafe {
101
+
102
102
let cb = self . get_cb ;
103
- let result = cb (
103
+ let result = unsafe { cb (
104
104
userdata,
105
105
& key,
106
106
remove as c_int ,
107
107
data. as_mut_ptr ( ) ,
108
108
data. len ( ) ,
109
109
& mut out_n,
110
- ) ;
110
+ ) } ;
111
111
let result: rustls_result =
112
112
rustls_result:: try_from ( result) . unwrap_or ( rustls_result:: General ) ;
113
113
match result {
114
114
rustls_result:: Ok => {
115
- data. set_len ( out_n) ;
115
+ unsafe { data. set_len ( out_n) } ;
116
116
Some ( data)
117
117
}
118
118
_ => None ,
119
119
}
120
- }
120
+
121
121
}
122
122
123
123
fn store ( & self , key : Vec < u8 > , value : Vec < u8 > ) -> bool {
You can’t perform that action at this time.
0 commit comments