mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Refactor Error enum usage to consistently be qualified
This commit is contained in:
parent
94816bb3b4
commit
ba86131cd5
19 changed files with 139 additions and 161 deletions
|
@ -9,7 +9,6 @@ use dom::bindings::codegen::Bindings::WebSocketBinding::{BinaryType, WebSocketMe
|
|||
use dom::bindings::codegen::InheritTypes::EventCast;
|
||||
use dom::bindings::codegen::InheritTypes::EventTargetCast;
|
||||
use dom::bindings::conversions::ToJSValConvertible;
|
||||
use dom::bindings::error::Error::{InvalidAccess, Syntax};
|
||||
use dom::bindings::error::{Error, Fallible};
|
||||
use dom::bindings::global::{GlobalField, GlobalRef};
|
||||
use dom::bindings::js::Root;
|
||||
|
@ -146,15 +145,15 @@ impl WebSocket {
|
|||
// https://tools.ietf.org/html/rfc6455#section-4.1
|
||||
// Handshake requirements, step 10
|
||||
if protocol.is_empty() {
|
||||
return Err(Syntax);
|
||||
return Err(Error::Syntax);
|
||||
}
|
||||
|
||||
if protocols[i + 1..].iter().any(|p| p == protocol) {
|
||||
return Err(Syntax);
|
||||
return Err(Error::Syntax);
|
||||
}
|
||||
|
||||
if protocol.chars().any(|c| c < '\u{0021}' || c > '\u{007E}') {
|
||||
return Err(Syntax);
|
||||
return Err(Error::Syntax);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue