Unverified Commit 00e751b9 authored by Guillaume Martres's avatar Guillaume Martres Committed by GitHub

Merge pull request #926 from smarter/make-debug

Make the debug printing of Plane more useful
parents ebe37b53 43e7025f
......@@ -10,6 +10,7 @@
#![allow(clippy::cast_lossless)]
use std::iter::FusedIterator;
use std::fmt::{Debug, Formatter};
use util::*;
......@@ -33,12 +34,18 @@ pub struct PlaneOffset {
pub y: isize
}
#[derive(Debug, Clone)]
#[derive(Clone)]
pub struct Plane {
pub data: Vec<u16>,
pub cfg: PlaneConfig
}
impl Debug for Plane {
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
write!(f, "Plane {{ data: [{}, ...], cfg: {:?} }}", self.data[0], self.cfg)
}
}
impl Plane {
/// Stride alignment in bytes.
const STRIDE_ALIGNMENT_LOG2: usize = 4;
......@@ -250,7 +257,7 @@ impl<'a> Iterator for PlaneIter<'a> {
}
}
#[derive(Clone, Copy)]
#[derive(Clone, Copy, Debug)]
pub struct PlaneSlice<'a> {
pub plane: &'a Plane,
pub x: isize,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment