Improve Debug
implementation of cache::State
This commit is contained in:
parent
012b4adec7
commit
b6926d9ab4
@ -21,7 +21,6 @@ pub struct Cache<T: Drawable> {
|
|||||||
state: RefCell<State>,
|
state: RefCell<State>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
enum State {
|
enum State {
|
||||||
Empty,
|
Empty,
|
||||||
Filled {
|
Filled {
|
||||||
@ -99,3 +98,17 @@ where
|
|||||||
mesh
|
mesh
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Debug for State {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
match self {
|
||||||
|
State::Empty => write!(f, "Empty"),
|
||||||
|
State::Filled { mesh, bounds } => f
|
||||||
|
.debug_struct("Filled")
|
||||||
|
.field("vertices", &mesh.vertices.len())
|
||||||
|
.field("indices", &mesh.indices.len())
|
||||||
|
.field("bounds", bounds)
|
||||||
|
.finish(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user