mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
fix: omitted the let
bindings (#31908)
This commit is contained in:
parent
da76ebabe9
commit
ff95ce5abd
9 changed files with 20 additions and 26 deletions
|
@ -236,7 +236,7 @@ impl DOMString {
|
|||
}
|
||||
|
||||
let first_non_whitespace = self.0.find(|ref c| !char::is_ascii_whitespace(c)).unwrap();
|
||||
let _ = self.0.replace_range(0..first_non_whitespace, "");
|
||||
self.0.replace_range(0..first_non_whitespace, "");
|
||||
}
|
||||
|
||||
/// Validates this `DOMString` is a time string according to
|
||||
|
|
|
@ -1869,7 +1869,7 @@ impl HTMLInputElement {
|
|||
let (chan, recv) = ipc::channel(self.global().time_profiler_chan().clone())
|
||||
.expect("Error initializing channel");
|
||||
let msg = FileManagerThreadMsg::SelectFiles(filter, chan, origin, opt_test_paths);
|
||||
let _ = resource_threads
|
||||
resource_threads
|
||||
.send(CoreResourceMsg::ToFileManager(msg))
|
||||
.unwrap();
|
||||
|
||||
|
@ -1896,7 +1896,7 @@ impl HTMLInputElement {
|
|||
let (chan, recv) = ipc::channel(self.global().time_profiler_chan().clone())
|
||||
.expect("Error initializing channel");
|
||||
let msg = FileManagerThreadMsg::SelectFile(filter, chan, origin, opt_test_path);
|
||||
let _ = resource_threads
|
||||
resource_threads
|
||||
.send(CoreResourceMsg::ToFileManager(msg))
|
||||
.unwrap();
|
||||
|
||||
|
@ -2582,7 +2582,7 @@ impl VirtualMethods for HTMLInputElement {
|
|||
{
|
||||
if event.IsTrusted() {
|
||||
let window = window_from_node(self);
|
||||
let _ = window
|
||||
window
|
||||
.task_manager()
|
||||
.user_interaction_task_source()
|
||||
.queue_event(
|
||||
|
|
|
@ -652,7 +652,7 @@ impl VirtualMethods for HTMLTextAreaElement {
|
|||
} else if event.type_() == atom!("keypress") && !event.DefaultPrevented() {
|
||||
if event.IsTrusted() {
|
||||
let window = window_from_node(self);
|
||||
let _ = window
|
||||
window
|
||||
.task_manager()
|
||||
.user_interaction_task_source()
|
||||
.queue_event(
|
||||
|
|
|
@ -240,8 +240,7 @@ impl MediaSessionMethods for MediaSession {
|
|||
if let Some(media_instance) = self.media_instance.get() {
|
||||
media_instance.set_duration(state.duration.map(|v| *v).unwrap());
|
||||
// If the playbackRate is not present or its value is null, set it to 1.0.
|
||||
let _ =
|
||||
media_instance.SetPlaybackRate(state.playbackRate.unwrap_or(Finite::wrap(1.0)))?;
|
||||
media_instance.SetPlaybackRate(state.playbackRate.unwrap_or(Finite::wrap(1.0)))?;
|
||||
// If the position is not present or its value is null, set it to zero.
|
||||
media_instance.SetCurrentTime(state.position.unwrap_or(Finite::wrap(0.0)));
|
||||
}
|
||||
|
|
|
@ -4154,8 +4154,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
|||
constants::UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES => unsafe {
|
||||
let values = values.iter().map(|&v| v as u32).collect::<Vec<_>>();
|
||||
rooted!(in(*cx) let mut result = ptr::null_mut::<JSObject>());
|
||||
let _ = Uint32Array::create(*cx, CreateWith::Slice(&values), result.handle_mut())
|
||||
.unwrap();
|
||||
Uint32Array::create(*cx, CreateWith::Slice(&values), result.handle_mut()).unwrap();
|
||||
ObjectValue(result.get())
|
||||
},
|
||||
constants::UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER |
|
||||
|
@ -4385,7 +4384,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
|||
));
|
||||
|
||||
rooted!(in(*cx) let mut rval = ptr::null_mut::<JSObject>());
|
||||
let _ = Int32Array::create(
|
||||
Int32Array::create(
|
||||
*cx,
|
||||
CreateWith::Slice(&receiver.recv().unwrap()),
|
||||
rval.handle_mut(),
|
||||
|
|
|
@ -982,7 +982,7 @@ impl WebGLFramebuffer {
|
|||
|
||||
impl Drop for WebGLFramebuffer {
|
||||
fn drop(&mut self) {
|
||||
let _ = self.delete(Operation::Fallible);
|
||||
self.delete(Operation::Fallible);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2066,7 +2066,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
let format_ids = self.extension_manager.get_tex_compression_ids();
|
||||
|
||||
rooted!(in(*cx) let mut rval = ptr::null_mut::<JSObject>());
|
||||
let _ = Uint32Array::create(*cx, CreateWith::Slice(&format_ids), rval.handle_mut())
|
||||
Uint32Array::create(*cx, CreateWith::Slice(&format_ids), rval.handle_mut())
|
||||
.unwrap();
|
||||
return ObjectValue(rval.get());
|
||||
},
|
||||
|
@ -2165,7 +2165,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
let (sender, receiver) = webgl_channel().unwrap();
|
||||
self.send_command(WebGLCommand::GetParameterInt2(param, sender));
|
||||
rooted!(in(*cx) let mut rval = ptr::null_mut::<JSObject>());
|
||||
let _ = Int32Array::create(
|
||||
Int32Array::create(
|
||||
*cx,
|
||||
CreateWith::Slice(&receiver.recv().unwrap()),
|
||||
rval.handle_mut(),
|
||||
|
@ -2177,7 +2177,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
let (sender, receiver) = webgl_channel().unwrap();
|
||||
self.send_command(WebGLCommand::GetParameterInt4(param, sender));
|
||||
rooted!(in(*cx) let mut rval = ptr::null_mut::<JSObject>());
|
||||
let _ = Int32Array::create(
|
||||
Int32Array::create(
|
||||
*cx,
|
||||
CreateWith::Slice(&receiver.recv().unwrap()),
|
||||
rval.handle_mut(),
|
||||
|
@ -2194,7 +2194,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
let (sender, receiver) = webgl_channel().unwrap();
|
||||
self.send_command(WebGLCommand::GetParameterFloat2(param, sender));
|
||||
rooted!(in(*cx) let mut rval = ptr::null_mut::<JSObject>());
|
||||
let _ = Float32Array::create(
|
||||
Float32Array::create(
|
||||
*cx,
|
||||
CreateWith::Slice(&receiver.recv().unwrap()),
|
||||
rval.handle_mut(),
|
||||
|
@ -2206,7 +2206,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
let (sender, receiver) = webgl_channel().unwrap();
|
||||
self.send_command(WebGLCommand::GetParameterFloat4(param, sender));
|
||||
rooted!(in(*cx) let mut rval = ptr::null_mut::<JSObject>());
|
||||
let _ = Float32Array::create(
|
||||
Float32Array::create(
|
||||
*cx,
|
||||
CreateWith::Slice(&receiver.recv().unwrap()),
|
||||
rval.handle_mut(),
|
||||
|
@ -3380,7 +3380,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
let value = [x, y, z, w];
|
||||
unsafe {
|
||||
rooted!(in(*cx) let mut result = ptr::null_mut::<JSObject>());
|
||||
let _ = Float32Array::create(
|
||||
Float32Array::create(
|
||||
*cx,
|
||||
CreateWith::Slice(&value),
|
||||
result.handle_mut(),
|
||||
|
@ -3393,12 +3393,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
let value = [x, y, z, w];
|
||||
unsafe {
|
||||
rooted!(in(*cx) let mut result = ptr::null_mut::<JSObject>());
|
||||
let _ = Int32Array::create(
|
||||
*cx,
|
||||
CreateWith::Slice(&value),
|
||||
result.handle_mut(),
|
||||
)
|
||||
.unwrap();
|
||||
Int32Array::create(*cx, CreateWith::Slice(&value), result.handle_mut())
|
||||
.unwrap();
|
||||
return ObjectValue(result.get());
|
||||
}
|
||||
},
|
||||
|
@ -3406,7 +3402,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
let value = [x, y, z, w];
|
||||
unsafe {
|
||||
rooted!(in(*cx) let mut result = ptr::null_mut::<JSObject>());
|
||||
let _ = Uint32Array::create(
|
||||
Uint32Array::create(
|
||||
*cx,
|
||||
CreateWith::Slice(&value),
|
||||
result.handle_mut(),
|
||||
|
|
|
@ -783,7 +783,7 @@ impl WindowMethods for Window {
|
|||
// which calls into https://html.spec.whatwg.org/multipage/#discard-a-document.
|
||||
window.discard_browsing_context();
|
||||
|
||||
let _ = window.send_to_constellation(ScriptMsg::DiscardTopLevelBrowsingContext);
|
||||
window.send_to_constellation(ScriptMsg::DiscardTopLevelBrowsingContext);
|
||||
}
|
||||
});
|
||||
self.task_manager()
|
||||
|
|
|
@ -1684,7 +1684,7 @@ fn fetch_single_module_script(
|
|||
match document {
|
||||
Some(doc) => doc.fetch_async(LoadType::Script(url), request, action_sender),
|
||||
None => {
|
||||
let _ = global
|
||||
global
|
||||
.resource_threads()
|
||||
.sender()
|
||||
.send(CoreResourceMsg::Fetch(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue