From 32b1a79967dadb2b62779d9f68cdac5c0575f82a Mon Sep 17 00:00:00 2001 From: Linden Krouse Date: Tue, 2 Mar 2021 17:08:18 -0500 Subject: [PATCH] Fixed reformatting --- src/sdl2/controller.rs | 2 +- src/sdl2/filesystem.rs | 2 +- src/sdl2/messagebox.rs | 2 +- src/sdl2/render.rs | 10 +++++----- src/sdl2/ttf/font.rs | 2 +- src/sdl2/video.rs | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/sdl2/controller.rs b/src/sdl2/controller.rs index 4e5ec1f9..62868db1 100644 --- a/src/sdl2/controller.rs +++ b/src/sdl2/controller.rs @@ -14,7 +14,7 @@ use std::mem::transmute; use crate::sys; -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum AddMappingError { InvalidMapping(NulError), InvalidFilePath(String), diff --git a/src/sdl2/filesystem.rs b/src/sdl2/filesystem.rs index aabf21b1..598c2aa5 100644 --- a/src/sdl2/filesystem.rs +++ b/src/sdl2/filesystem.rs @@ -23,7 +23,7 @@ pub fn base_path() -> Result { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum PrefPathError { InvalidOrganizationName(NulError), InvalidApplicationName(NulError), diff --git a/src/sdl2/messagebox.rs b/src/sdl2/messagebox.rs index ab8d278b..a90e57f3 100644 --- a/src/sdl2/messagebox.rs +++ b/src/sdl2/messagebox.rs @@ -103,7 +103,7 @@ impl Into for [sys::SDL_MessageBoxColor; 5] { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum ShowMessageError { InvalidTitle(NulError), InvalidMessage(NulError), diff --git a/src/sdl2/render.rs b/src/sdl2/render.rs index 07c6aa4d..ddaa507a 100644 --- a/src/sdl2/render.rs +++ b/src/sdl2/render.rs @@ -56,11 +56,11 @@ use crate::sys::SDL_BlendMode; use crate::sys::SDL_TextureAccess; /// Contains the description of an error returned by SDL -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct SdlError(String); /// Possible errors returned by targeting a `Canvas` to render to a `Texture` -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum TargetRenderError { SdlError(SdlError), NotSupported, @@ -732,7 +732,7 @@ impl CanvasBuilder { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum TextureValueError { WidthOverflows(u32), HeightOverflows(u32), @@ -1652,7 +1652,7 @@ impl Texture { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum UpdateTextureError { PitchOverflows(usize), PitchMustBeMultipleOfTwoForFormat(usize, PixelFormatEnum), @@ -1725,7 +1725,7 @@ impl Error for UpdateTextureError { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum UpdateTextureYUVError { PitchOverflows { plane: &'static str, diff --git a/src/sdl2/ttf/font.rs b/src/sdl2/ttf/font.rs index e6dda3a2..d99686b9 100644 --- a/src/sdl2/ttf/font.rs +++ b/src/sdl2/ttf/font.rs @@ -49,7 +49,7 @@ pub struct GlyphMetrics { pub type FontResult = Result; /// A font-related error. -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum FontError { /// A Latin-1 encoded byte string is invalid. InvalidLatin1Text(NulError), diff --git a/src/sdl2/video.rs b/src/sdl2/video.rs index 907f05ed..2235032d 100644 --- a/src/sdl2/video.rs +++ b/src/sdl2/video.rs @@ -960,7 +960,7 @@ impl VideoSubsystem { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum WindowBuildError { HeightOverflows(u32), WidthOverflows(u32),