Skip to content

Commit

Permalink
Remove unnecessary debug_asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Jun 9, 2023
1 parent 219093e commit c2a8a87
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/platform_impl/web/web_sys/resize_scaling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,7 @@ impl ResizeScaleInternal {
canvas: &HtmlCanvasElement,
entries: Array,
) -> PhysicalSize<u32> {
debug_assert_eq!(entries.length(), 1, "expected exactly one entry");
let entry = entries.get(0);
debug_assert!(entry.has_type::<ResizeObserverEntry>());
let entry: ResizeObserverEntry = entry.unchecked_into();
let entry: ResizeObserverEntry = entries.get(0).unchecked_into();

// Safari doesn't support `devicePixelContentBoxSize`
if !has_device_pixel_support() {
Expand All @@ -214,15 +211,10 @@ impl ResizeScaleInternal {
.to_physical(backend::scale_factor(window));
}

let entries = entry.device_pixel_content_box_size();
debug_assert_eq!(
entries.length(),
1,
"a canvas can't be split into multiple fragments"
);
let entry = entries.get(0);
debug_assert!(entry.has_type::<ResizeObserverSize>());
let entry: ResizeObserverSize = entry.unchecked_into();
let entry: ResizeObserverSize = entry
.device_pixel_content_box_size()
.get(0)
.unchecked_into();

let style = window
.get_computed_style(canvas)
Expand Down

0 comments on commit c2a8a87

Please sign in to comment.