mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +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
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue