mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-27 11:16:03 +00:00
Rustfmt on xy.rs
This commit is contained in:
parent
4fe7df220a
commit
12593c8ea8
11
src/xy.rs
11
src/xy.rs
@ -9,13 +9,10 @@ pub struct XY<T> {
|
|||||||
pub y: T,
|
pub y: T,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl <T> XY<T> {
|
impl<T> XY<T> {
|
||||||
/// Creates a new `XY` from the given values.
|
/// Creates a new `XY` from the given values.
|
||||||
pub fn new(x: T, y: T) -> Self {
|
pub fn new(x: T, y: T) -> Self {
|
||||||
XY {
|
XY { x: x, y: y }
|
||||||
x: x,
|
|
||||||
y: y,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destructure self into a pair.
|
/// Destructure self into a pair.
|
||||||
@ -34,14 +31,14 @@ impl <T> XY<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl <T: Copy> XY<T> {
|
impl<T: Copy> XY<T> {
|
||||||
/// Creates a `XY` with both `x` and `y` set to `value`.
|
/// Creates a `XY` with both `x` and `y` set to `value`.
|
||||||
pub fn both(value: T) -> Self {
|
pub fn both(value: T) -> Self {
|
||||||
XY::new(value, value)
|
XY::new(value, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl <T> From<(T, T)> for XY<T> {
|
impl<T> From<(T, T)> for XY<T> {
|
||||||
fn from((x, y): (T, T)) -> Self {
|
fn from((x, y): (T, T)) -> Self {
|
||||||
XY::new(x, y)
|
XY::new(x, y)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user