diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-11-26 20:48:17 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-27 04:48:17 +0000 |
commit | 9ffc6acdbb3326dde74c803332547b0ae33e483a (patch) | |
tree | e3d45392c1f6d41fac66f59c2f216f81b9a86c6e /ext/net/ops.rs | |
parent | 0012484f4f194664bea87879ab9f4f20f4ee86c6 (diff) |
perf(ops): Reenable fast unit result optimization (#16827)
The optimization was missed in the optimizer rewrite
https://github.com/denoland/deno/pull/16514
Diffstat (limited to 'ext/net/ops.rs')
-rw-r--r-- | ext/net/ops.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/net/ops.rs b/ext/net/ops.rs index 96de8cff1..e567c3188 100644 --- a/ext/net/ops.rs +++ b/ext/net/ops.rs @@ -67,8 +67,8 @@ pub fn init<P: NetPermissions + 'static>() -> Vec<OpDecl> { #[cfg(unix)] crate::ops_unix::op_net_send_unixpacket::decl::<P>(), op_dns_resolve::decl::<P>(), - op_set_nodelay::decl::<P>(), - op_set_keepalive::decl::<P>(), + op_set_nodelay::decl(), + op_set_keepalive::decl(), ] } @@ -509,7 +509,7 @@ where } #[op] -pub fn op_set_nodelay<NP>( +pub fn op_set_nodelay( state: &mut OpState, rid: ResourceId, nodelay: bool, @@ -521,7 +521,7 @@ pub fn op_set_nodelay<NP>( } #[op] -pub fn op_set_keepalive<NP>( +pub fn op_set_keepalive( state: &mut OpState, rid: ResourceId, keepalive: bool, @@ -836,7 +836,7 @@ mod tests { #[tokio::test(flavor = "multi_thread", worker_threads = 1)] async fn tcp_set_no_delay() { let set_nodelay = Box::new(|state: &mut OpState, rid| { - op_set_nodelay::call::<TestPermission>(state, rid, true).unwrap(); + op_set_nodelay::call(state, rid, true).unwrap(); }); let test_fn = Box::new(|socket: SockRef| { assert!(socket.nodelay().unwrap()); @@ -848,7 +848,7 @@ mod tests { #[tokio::test(flavor = "multi_thread", worker_threads = 1)] async fn tcp_set_keepalive() { let set_keepalive = Box::new(|state: &mut OpState, rid| { - op_set_keepalive::call::<TestPermission>(state, rid, true).unwrap(); + op_set_keepalive::call(state, rid, true).unwrap(); }); let test_fn = Box::new(|socket: SockRef| { assert!(!socket.nodelay().unwrap()); |