mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Remove needless returns
This commit is contained in:
parent
2e02ea38fc
commit
e94df1ed5c
14 changed files with 38 additions and 38 deletions
|
@ -661,7 +661,7 @@ unsafe fn get_dom_class(obj: *mut JSObject) -> Result<DOMClass, ()> {
|
|||
return Ok(*dom_class);
|
||||
}
|
||||
debug!("not a dom object");
|
||||
return Err(());
|
||||
Err(())
|
||||
}
|
||||
|
||||
/// Get a `*const libc::c_void` for the given DOM object, unwrapping any
|
||||
|
|
|
@ -87,14 +87,14 @@ pub unsafe extern fn prevent_extensions(_cx: *mut JSContext,
|
|||
_proxy: HandleObject,
|
||||
result: *mut ObjectOpResult) -> u8 {
|
||||
(*result).code_ = JSErrNum::JSMSG_CANT_PREVENT_EXTENSIONS as u32;
|
||||
return JSTrue;
|
||||
JSTrue
|
||||
}
|
||||
|
||||
/// Reports whether the object is Extensible
|
||||
pub unsafe extern fn is_extensible(_cx: *mut JSContext, _proxy: HandleObject,
|
||||
succeeded: *mut u8) -> u8 {
|
||||
*succeeded = JSTrue;
|
||||
return JSTrue;
|
||||
JSTrue
|
||||
}
|
||||
|
||||
/// Get the expando object, or null if there is none.
|
||||
|
@ -123,7 +123,7 @@ pub fn ensure_expando_object(cx: *mut JSContext, obj: HandleObject)
|
|||
|
||||
SetProxyExtra(obj.get(), JSPROXYSLOT_EXPANDO, ObjectValue(&*expando));
|
||||
}
|
||||
return expando;
|
||||
expando
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -381,7 +381,7 @@ fn create_interface_prototype_object(cx: *mut JSContext, global: HandleObject,
|
|||
pub unsafe extern fn throwing_constructor(cx: *mut JSContext, _argc: c_uint,
|
||||
_vp: *mut JSVal) -> u8 {
|
||||
throw_type_error(cx, "Illegal constructor.");
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
|
||||
/// An array of *mut JSObject of size PrototypeList::ID::Count
|
||||
|
@ -507,7 +507,7 @@ pub fn get_array_index_from_id(_cx: *mut JSContext, id: HandleId) -> Option<u32>
|
|||
if RUST_JSID_IS_INT(id) != 0 {
|
||||
return Some(RUST_JSID_TO_INT(id) as u32);
|
||||
}
|
||||
return None;
|
||||
None
|
||||
}
|
||||
// if id is length atom, -1, otherwise
|
||||
/*return if JSID_IS_ATOM(id) {
|
||||
|
@ -559,7 +559,7 @@ pub fn is_platform_object(obj: *mut JSObject) -> bool {
|
|||
clasp = js::jsapi::JS_GetClass(obj);
|
||||
}
|
||||
// TODO also check if JS_IsArrayBufferObject
|
||||
return is_dom_class(&*clasp);
|
||||
is_dom_class(&*clasp)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -631,8 +631,8 @@ pub fn has_property_on_prototype(cx: *mut JSContext, proxy: HandleObject,
|
|||
id: HandleId) -> bool {
|
||||
// MOZ_ASSERT(js::IsProxy(proxy) && js::GetProxyHandler(proxy) == handler);
|
||||
let mut found = false;
|
||||
return !get_property_on_prototype(cx, proxy, id, &mut found,
|
||||
MutableHandleValue { ptr: ptr::null_mut() }) || found;
|
||||
!get_property_on_prototype(cx, proxy, id, &mut found,
|
||||
MutableHandleValue { ptr: ptr::null_mut() }) || found
|
||||
}
|
||||
|
||||
/// Create a DOM global object with the given class.
|
||||
|
@ -812,11 +812,11 @@ pub fn validate_qualified_name(qualified_name: &str) -> ErrorResult {
|
|||
match xml_name_type(qualified_name) {
|
||||
XMLName::InvalidXMLName => {
|
||||
// Step 1.
|
||||
return Err(Error::InvalidCharacter);
|
||||
Err(Error::InvalidCharacter)
|
||||
},
|
||||
XMLName::Name => {
|
||||
// Step 2.
|
||||
return Err(Error::Namespace);
|
||||
Err(Error::Namespace)
|
||||
},
|
||||
XMLName::QName => Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue