diff --git a/src/sdl2/render.rs b/src/sdl2/render.rs index f4f1258f..c5a6372b 100644 --- a/src/sdl2/render.rs +++ b/src/sdl2/render.rs @@ -1121,6 +1121,23 @@ impl fmt::Display for UpdateTextureYUVError { } } +impl Error for UpdateTextureYUVError { + fn description(&self) -> &str { + use self::UpdateTextureYUVError::*; + + match *self { + PitchOverflows {..} => "pitch overflow", + InvalidPlaneLength {..} => "invalid plane length", + XMustBeMultipleOfTwoForFormat(_) => "x must be multiple of two", + YMustBeMultipleOfTwoForFormat(_) => "y must be multiple of two", + WidthMustBeMultipleOfTwoForFormat(_) => "width must be multiple of two", + HeightMustBeMultipleOfTwoForFormat(_) => "height must be multiple of two", + RectNotInsideTexture(_) => "rect must be inside texture", + SdlError(ref e) => e, + } + } +} + impl Texture { #[inline] fn check_renderer(&self) {