Skip to content

Commit

Permalink
Fix Build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
richarddushime committed Mar 19, 2024
1 parent a9a2d01 commit 62aa22f
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion components/script/dom/servoparser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ impl TreeSink for Sink {
let element = create_element_for_token(
name,
attrs,
*self.document,
&*self.document,
ElementCreator::ParserCreated(self.current_line),
self.parsing_algorithm,
);
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/testbinding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ impl TestBindingMethods for TestBinding {
resolve.map(SimpleHandler::new),
reject.map(SimpleHandler::new),
);
let p = Promise::new_in_current_realm(comp());
let p = Promise::new_in_current_realm(comp.clone());
p.append_native_handler(&handler, comp);
return p;

Expand Down
6 changes: 3 additions & 3 deletions components/script/dom/webgl2renderingcontext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2954,7 +2954,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
if pixel_unpack_buffer == tf_buffer {
return {
self.base.webgl_error(InvalidOperation);
ok(())
Ok(())
};
}
}
Expand Down Expand Up @@ -3024,7 +3024,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
if self.bound_pixel_unpack_buffer.get().is_some() {
return {
self.base.webgl_error(InvalidOperation);
ok(())
Ok(())
};
}

Expand Down Expand Up @@ -3103,7 +3103,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
if type_ == constants::FLOAT_32_UNSIGNED_INT_24_8_REV {
return {
self.base.webgl_error(InvalidOperation);
ok(())
Ok(())
};
}

Expand Down
3 changes: 2 additions & 1 deletion components/script/dom/webgl_extensions/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ impl WebGLExtensions {
.borrow()
.tex_compression_formats
.keys()
.copied()
.map(|&k| k)
.collect()
}

fn register_all_extensions(&self) {
Expand Down
4 changes: 2 additions & 2 deletions components/script/dom/webglrenderingcontext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4336,7 +4336,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
if buff.len() < expected_byte_length as usize {
return {
self.webgl_error(InvalidOperation);
ok(())
Ok(())
};
}

Expand Down Expand Up @@ -4527,7 +4527,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
if buff.len() < expected_byte_length as usize {
return {
self.webgl_error(InvalidOperation);
ok(())
Ok(())
};
}

Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/webgltexture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl WebGLTexture {
let face_count = match target {
constants::TEXTURE_2D => 1,
constants::TEXTURE_CUBE_MAP => 6,
_ => Err(WebGLError::InvalidEnum),
_ => return Err(WebGLError::InvalidEnum),
};
self.face_count.set(face_count);
self.target.set(Some(target));
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/worklet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ impl WorkletThread {
let global =
self.get_worklet_global_scope(pipeline_id, worklet_id, global_type, base_url);
self.fetch_and_invoke_a_worklet_script(
*global,
&global,
pipeline_id,
origin,
script_url,
Expand Down
2 changes: 1 addition & 1 deletion components/script/script_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ impl FetchResponseListener for ModuleContext {
let meta = self.metadata.take().unwrap();

if let Some(content_type) = meta.content_type.map(Serde::into_inner) {
if let Ok(content_type) = Mime::from_str(&content_type) {
if let Ok(content_type) = Mime::from_str(&content_type.to_string()) {
let essence_mime = content_type.essence_str();

if !SCRIPT_JS_MIMES.contains(&essence_mime) {
Expand Down

0 comments on commit 62aa22f

Please sign in to comment.