Commit 758e811 1 parent 9008488 commit 758e811 Copy full SHA for 758e811
File tree 2 files changed +16
-15
lines changed
2 files changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -78,12 +78,12 @@ pub struct rustls_slice_slice_bytes<'a> {
78
78
/// returns 0.
79
79
#[ no_mangle]
80
80
pub extern "C" fn rustls_slice_slice_bytes_len ( input : * const rustls_slice_slice_bytes ) -> size_t {
81
- unsafe {
82
- match input. as_ref ( ) {
81
+
82
+ match unsafe { input. as_ref ( ) } {
83
83
Some ( c) => c. inner . len ( ) ,
84
84
None => 0 ,
85
85
}
86
- }
86
+
87
87
}
88
88
89
89
/// Retrieve the nth element from the input slice of slices. If the input
@@ -94,8 +94,8 @@ pub extern "C" fn rustls_slice_slice_bytes_get(
94
94
input : * const rustls_slice_slice_bytes ,
95
95
n : size_t ,
96
96
) -> rustls_slice_bytes {
97
- let input: & rustls_slice_slice_bytes = unsafe {
98
- match input. as_ref ( ) {
97
+ let input: & rustls_slice_slice_bytes = {
98
+ match unsafe { input. as_ref ( ) } {
99
99
Some ( c) => c,
100
100
None => {
101
101
return rustls_slice_bytes {
Original file line number Diff line number Diff line change @@ -96,23 +96,24 @@ impl SessionStoreBroker {
96
96
// See <https://github.com/rustls/rustls-ffi/pull/64#issuecomment-800766940>
97
97
let mut data: Vec < u8 > = vec ! [ 0 ; 65 * 1024 ] ;
98
98
let mut out_n: size_t = 0 ;
99
- unsafe {
100
- let cb = self . get_cb ;
101
- let result = cb (
99
+
100
+ let cb = self . get_cb ;
101
+ let result = unsafe {
102
+ cb (
102
103
userdata,
103
104
& key,
104
105
remove as c_int ,
105
106
data. as_mut_ptr ( ) ,
106
107
data. len ( ) ,
107
108
& mut out_n,
108
- ) ;
109
- match rustls_result:: from ( result) {
110
- rustls_result:: Ok => {
111
- data. set_len ( out_n) ;
112
- Some ( data)
113
- }
114
- _ => None ,
109
+ )
110
+ } ;
111
+ match rustls_result:: from ( result) {
112
+ rustls_result:: Ok => {
113
+ unsafe { data. set_len ( out_n) } ;
114
+ Some ( data)
115
115
}
116
+ _ => None ,
116
117
}
117
118
}
118
119
You can’t perform that action at this time.
0 commit comments