space: Make `RenderError` require Debug
This commit is contained in:
parent
8059bdc5db
commit
58f20fb6c7
|
@ -18,7 +18,7 @@ use crate::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use indexmap::{IndexMap, IndexSet};
|
use indexmap::{IndexMap, IndexSet};
|
||||||
use std::{cell::RefCell, collections::VecDeque};
|
use std::{cell::RefCell, collections::VecDeque, fmt};
|
||||||
use wayland_server::protocol::wl_surface::WlSurface;
|
use wayland_server::protocol::wl_surface::WlSurface;
|
||||||
|
|
||||||
mod element;
|
mod element;
|
||||||
|
@ -682,7 +682,7 @@ impl Space {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Errors thrown by [`Space::render_output`]
|
/// Errors thrown by [`Space::render_output`]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(thiserror::Error)]
|
||||||
pub enum RenderError<R: Renderer> {
|
pub enum RenderError<R: Renderer> {
|
||||||
/// The provided [`Renderer`] did return an error during an operation
|
/// The provided [`Renderer`] did return an error during an operation
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
|
@ -694,3 +694,13 @@ pub enum RenderError<R: Renderer> {
|
||||||
#[error("Output was not mapped to this space")]
|
#[error("Output was not mapped to this space")]
|
||||||
UnmappedOutput,
|
UnmappedOutput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<R: Renderer> fmt::Debug for RenderError<R> {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
match self {
|
||||||
|
RenderError::Rendering(err) => fmt::Debug::fmt(err, f),
|
||||||
|
RenderError::OutputNoMode => f.write_str("Output has no active move"),
|
||||||
|
RenderError::UnmappedOutput => f.write_str("Output was not mapped to this space"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue