mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
clipping: Fix some warnings in components/script/dom
(#31799)
* fix clippy websocket errors * fix clippy window errors * fix clippy window errors * fix clippy window errors
This commit is contained in:
parent
4b408a3724
commit
ce0d456469
2 changed files with 16 additions and 22 deletions
|
@ -368,7 +368,7 @@ impl WebSocketMethods for WebSocket {
|
|||
let send_data = self.send_impl(data_byte_len)?;
|
||||
|
||||
if send_data {
|
||||
let bytes = blob.get_bytes().unwrap_or(vec![]);
|
||||
let bytes = blob.get_bytes().unwrap_or_default();
|
||||
let _ = self
|
||||
.sender
|
||||
.send(WebSocketDomAction::SendMessage(MessageData::Binary(bytes)));
|
||||
|
@ -409,7 +409,7 @@ impl WebSocketMethods for WebSocket {
|
|||
fn Close(&self, code: Option<u16>, reason: Option<USVString>) -> ErrorResult {
|
||||
if let Some(code) = code {
|
||||
//Fail if the supplied code isn't normal and isn't reserved for libraries, frameworks, and applications
|
||||
if code != close_code::NORMAL && (code < 3000 || code > 4999) {
|
||||
if code != close_code::NORMAL && !(3000..=4999).contains(&code) {
|
||||
return Err(Error::InvalidAccess);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue