Flesh out gpui2 test support

This commit is contained in:
Conrad Irwin 2023-11-06 20:44:03 -07:00
parent eb325fb387
commit 8e799b6e22
7 changed files with 271 additions and 13 deletions

View file

@ -25,6 +25,10 @@ impl<T: Clone + Debug + Default> Point<T> {
Self { x, y }
}
pub fn zero() -> Self {
Self::new(T::default(), T::default())
}
pub fn map<U: Clone + Default + Debug>(&self, f: impl Fn(T) -> U) -> Point<U> {
Point {
x: f(self.x.clone()),