mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
clippy: fix warnings in components/shared (#31565)
* clippy: fix some warnings in components/shared * fix: unit tests * fix: review comments
This commit is contained in:
parent
3a5ca785d3
commit
43f44965cd
14 changed files with 102 additions and 139 deletions
|
@ -140,10 +140,7 @@ pub struct WebGLMsgSender {
|
|||
|
||||
impl WebGLMsgSender {
|
||||
pub fn new(id: WebGLContextId, sender: WebGLChan) -> Self {
|
||||
WebGLMsgSender {
|
||||
ctx_id: id,
|
||||
sender: sender,
|
||||
}
|
||||
WebGLMsgSender { ctx_id: id, sender }
|
||||
}
|
||||
|
||||
/// Returns the WebGLContextId associated to this sender
|
||||
|
@ -922,7 +919,7 @@ mod gl_ext_constants {
|
|||
pub const COMPRESSED_RGBA_S3TC_DXT5_EXT: GLenum = 0x83F3;
|
||||
pub const COMPRESSED_RGB_ETC1_WEBGL: GLenum = 0x8D64;
|
||||
|
||||
pub static COMPRESSIONS: &'static [GLenum] = &[
|
||||
pub static COMPRESSIONS: &[GLenum] = &[
|
||||
COMPRESSED_RGB_S3TC_DXT1_EXT,
|
||||
COMPRESSED_RGBA_S3TC_DXT1_EXT,
|
||||
COMPRESSED_RGBA_S3TC_DXT3_EXT,
|
||||
|
@ -1061,18 +1058,18 @@ impl TexFormat {
|
|||
|
||||
/// Returns whether this format is a known sized or unsized format.
|
||||
pub fn is_sized(&self) -> bool {
|
||||
match self {
|
||||
!matches!(
|
||||
self,
|
||||
TexFormat::DepthComponent |
|
||||
TexFormat::DepthStencil |
|
||||
TexFormat::Alpha |
|
||||
TexFormat::Red |
|
||||
TexFormat::RG |
|
||||
TexFormat::RGB |
|
||||
TexFormat::RGBA |
|
||||
TexFormat::Luminance |
|
||||
TexFormat::LuminanceAlpha => false,
|
||||
_ => true,
|
||||
}
|
||||
TexFormat::DepthStencil |
|
||||
TexFormat::Alpha |
|
||||
TexFormat::Red |
|
||||
TexFormat::RG |
|
||||
TexFormat::RGB |
|
||||
TexFormat::RGBA |
|
||||
TexFormat::Luminance |
|
||||
TexFormat::LuminanceAlpha
|
||||
)
|
||||
}
|
||||
|
||||
pub fn to_unsized(self) -> TexFormat {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue