mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Fix some warnings in future Rust nightlies
This commit is contained in:
parent
7281336116
commit
fdcc7653f2
8 changed files with 20 additions and 45 deletions
|
@ -47,10 +47,12 @@ pub enum TexImageValidationError {
|
|||
InvalidOffsets,
|
||||
}
|
||||
|
||||
impl std::error::Error for TexImageValidationError {
|
||||
fn description(&self) -> &str {
|
||||
impl std::error::Error for TexImageValidationError {}
|
||||
|
||||
impl fmt::Display for TexImageValidationError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
use self::TexImageValidationError::*;
|
||||
match *self {
|
||||
let description = match *self {
|
||||
InvalidTextureTarget(_) => "Invalid texture target",
|
||||
TextureTargetNotBound(_) => "Texture was not bound",
|
||||
InvalidCubicTextureDimensions => {
|
||||
|
@ -68,17 +70,8 @@ impl std::error::Error for TexImageValidationError {
|
|||
NonPotTexture => "Expected a power of two texture",
|
||||
InvalidCompressionFormat => "Unrecognized texture compression format",
|
||||
InvalidOffsets => "Invalid X/Y texture offset parameters",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for TexImageValidationError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"TexImageValidationError({})",
|
||||
std::error::Error::description(self)
|
||||
)
|
||||
};
|
||||
write!(f, "TexImageValidationError({})", description)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue