mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Remove ref_filter_map
dependency (#36857)
Instead, use the `filter_map` functions of `std::cell::Ref` and `accountable_refcell::Ref`, which provide the same functionality as `ref_filter_map`. Testing: Refactoring for removing dependency. No extra test is needed. Fixes: #36851 --------- Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
This commit is contained in:
parent
edea2caec1
commit
1271dbf6ec
8 changed files with 15 additions and 23 deletions
|
@ -31,7 +31,7 @@ pub(crate) use crate::canvas_context::*;
|
|||
use crate::conversions::Convert;
|
||||
use crate::dom::attr::Attr;
|
||||
use crate::dom::bindings::callback::ExceptionHandling;
|
||||
use crate::dom::bindings::cell::{DomRefCell, Ref, ref_filter_map};
|
||||
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLCanvasElementBinding::{
|
||||
BlobCallback, HTMLCanvasElementMethods, RenderingContext as RootedRenderingContext,
|
||||
};
|
||||
|
@ -225,7 +225,7 @@ impl LayoutHTMLCanvasElementHelpers for LayoutDom<'_, HTMLCanvasElement> {
|
|||
|
||||
impl HTMLCanvasElement {
|
||||
pub(crate) fn context(&self) -> Option<Ref<RenderingContext>> {
|
||||
ref_filter_map(self.context_mode.borrow(), |ctx| ctx.as_ref())
|
||||
Ref::filter_map(self.context_mode.borrow(), |ctx| ctx.as_ref()).ok()
|
||||
}
|
||||
|
||||
fn get_or_init_2d_context(&self, can_gc: CanGc) -> Option<DomRoot<CanvasRenderingContext2D>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue