1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-01 16:51:13 -05:00

revert unnecessary change

This commit is contained in:
Yoshiya Hinosawa 2024-10-01 15:50:02 +09:00
parent 60b3f3742d
commit 17bb2c46eb
No known key found for this signature in database
GPG key ID: 9017DB4559488785

View file

@ -333,10 +333,7 @@ pub fn take_network_stream_resource(
if let Ok(resource_rc) = resource_table.take::<TcpStreamResource>(stream_rid) if let Ok(resource_rc) = resource_table.take::<TcpStreamResource>(stream_rid)
{ {
// This TCP connection might be used somewhere else. // This TCP connection might be used somewhere else.
let resource: crate::io::FullDuplexResource< let resource = Rc::try_unwrap(resource_rc)
tokio::net::tcp::OwnedReadHalf,
tokio::net::tcp::OwnedWriteHalf,
> = Rc::try_unwrap(resource_rc)
.map_err(|_| bad_resource("TCP stream is currently in use"))?; .map_err(|_| bad_resource("TCP stream is currently in use"))?;
let (read_half, write_half) = resource.into_inner(); let (read_half, write_half) = resource.into_inner();
let tcp_stream = read_half.reunite(write_half)?; let tcp_stream = read_half.reunite(write_half)?;