mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
This reverts commit d76014192d
.
This commit is contained in:
parent
449b1317c8
commit
c0482e09c3
1 changed files with 6 additions and 12 deletions
|
@ -504,12 +504,9 @@ pub fn op_ws_try_send_string(
|
|||
state: &mut OpState,
|
||||
rid: ResourceId,
|
||||
text: String,
|
||||
) -> bool {
|
||||
let resource = match state.resource_table.get::<WsStreamResource>(rid) {
|
||||
Ok(resource) => resource,
|
||||
Err(_) => return false,
|
||||
};
|
||||
resource.try_send(Message::Text(text)).is_ok()
|
||||
) -> Result<bool, AnyError> {
|
||||
let resource = state.resource_table.get::<WsStreamResource>(rid)?;
|
||||
resource.try_send(Message::Text(text))
|
||||
}
|
||||
|
||||
#[op(fast)]
|
||||
|
@ -517,12 +514,9 @@ pub fn op_ws_try_send_binary(
|
|||
state: &mut OpState,
|
||||
rid: u32,
|
||||
value: &[u8],
|
||||
) -> bool {
|
||||
let resource = match state.resource_table.get::<WsStreamResource>(rid) {
|
||||
Ok(resource) => resource,
|
||||
Err(_) => return false,
|
||||
};
|
||||
resource.try_send(Message::Binary(value.to_vec())).is_ok()
|
||||
) -> Result<bool, AnyError> {
|
||||
let resource = state.resource_table.get::<WsStreamResource>(rid)?;
|
||||
resource.try_send(Message::Binary(value.to_vec()))
|
||||
}
|
||||
|
||||
#[op(deferred)]
|
||||
|
|
Loading…
Reference in a new issue