mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
clippy: Fix a few problems in components/script/dom
(#31955)
* fixed various clippy warnings * fixed various clippy warnings * fixed various clippy warnings
This commit is contained in:
parent
9401102691
commit
00c4d798c9
5 changed files with 7 additions and 9 deletions
|
@ -106,13 +106,13 @@ impl VertexArrayObject {
|
|||
.get_mut(index as usize)
|
||||
.ok_or(WebGLError::InvalidValue)?;
|
||||
|
||||
if size < 1 || size > 4 {
|
||||
if !(1..=4).contains(&size) {
|
||||
return Err(WebGLError::InvalidValue);
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#BUFFER_OFFSET_AND_STRIDE
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#VERTEX_STRIDE
|
||||
if stride < 0 || stride > 255 || offset < 0 {
|
||||
if !(0..=255).contains(&stride) || offset < 0 {
|
||||
return Err(WebGLError::InvalidValue);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue