Skip to content

Commit

Permalink
Fix clippy issues and formatting in bindings (#3659)
Browse files Browse the repository at this point in the history
Co-authored-by: Ubuntu <[email protected]>
  • Loading branch information
WesleyRosenblum and Ubuntu authored Nov 28, 2022
1 parent cf22c4b commit 2e67a8a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bindings/rust/s2n-tls/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl Builder {
crate::init::init();
let config = unsafe { s2n_config_new().into_result() }.unwrap();

let context = Box::new(Context::default());
let context = Box::<Context>::default();
let context = Box::into_raw(context) as *mut c_void;

unsafe {
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/s2n-tls/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl Connection {
}

fn init_context(&mut self) {
let context = Box::new(Context::default());
let context = Box::<Context>::default();
let context = Box::into_raw(context) as *mut c_void;
// allocate a new context object
unsafe {
Expand Down
5 changes: 3 additions & 2 deletions bindings/rust/s2n-tls/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,10 @@ mod tests {
let conn = pooled_conn.deref();
assert_eq!(pooled_conn.config(), conn.config());

let mut mut_pooled_conn: PooledConnection<ConfigPoolRef> = PooledConnection::new(&config_pool)?;
let mut mut_pooled_conn: PooledConnection<ConfigPoolRef> =
PooledConnection::new(&config_pool)?;
let waker = futures_test::task::new_count_waker().0;
mut_pooled_conn.set_waker(Some(&waker.clone()))?;
mut_pooled_conn.set_waker(Some(&waker))?;
assert!(mut_pooled_conn.waker().unwrap().will_wake(&waker));

Ok(())
Expand Down

0 comments on commit 2e67a8a

Please sign in to comment.