Derive Default for XY (#509)

This patch derives Default for XY<T>.  This makes it easier to deal with
types like XY<usize>.
This commit is contained in:
Robin Krahl 2020-10-06 22:12:29 +02:00 committed by GitHub
parent f694e2ae25
commit 02ce9f8a35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@ use crate::direction::Orientation;
use std::iter;
/// A generic structure with a value for each axis.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
pub struct XY<T> {
/// X-axis value
pub x: T,