diff options
author | Kingsley Yung <kingsley@kkoyung.dev> | 2025-05-18 22:00:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-18 14:00:58 +0000 |
commit | 1271dbf6ec5937b7d71378c77b1e6fbec736691b (patch) | |
tree | 8085323de4f6fc3883aa909972b3810a8099eecc /components/script/dom/vertexarrayobject.rs | |
parent | edea2caec148910965899670c4267064679cf4ed (diff) | |
download | servo-1271dbf6ec5937b7d71378c77b1e6fbec736691b.tar.gz servo-1271dbf6ec5937b7d71378c77b1e6fbec736691b.zip |
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>
Diffstat (limited to 'components/script/dom/vertexarrayobject.rs')
-rw-r--r-- | components/script/dom/vertexarrayobject.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/components/script/dom/vertexarrayobject.rs b/components/script/dom/vertexarrayobject.rs index 7da5cf7195b..27f65bde7ee 100644 --- a/components/script/dom/vertexarrayobject.rs +++ b/components/script/dom/vertexarrayobject.rs @@ -8,7 +8,7 @@ use canvas_traits::webgl::{ ActiveAttribInfo, WebGLCommand, WebGLError, WebGLResult, WebGLVersion, WebGLVertexArrayId, }; -use crate::dom::bindings::cell::{DomRefCell, Ref, ref_filter_map}; +use crate::dom::bindings::cell::{DomRefCell, Ref}; use crate::dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2RenderingContextConstants as constants2; use crate::dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use crate::dom::bindings::root::{Dom, MutNullableDom}; @@ -83,9 +83,10 @@ impl VertexArrayObject { } pub(crate) fn get_vertex_attrib(&self, index: u32) -> Option<Ref<VertexAttribData>> { - ref_filter_map(self.vertex_attribs.borrow(), |attribs| { + Ref::filter_map(self.vertex_attribs.borrow(), |attribs| { attribs.get(index as usize) }) + .ok() } pub(crate) fn set_vertex_attrib_type(&self, index: u32, type_: u32) { |