WIP: Start geometry crate

Mikayla created

Change summary

crates/gpui/src/geometry.rs | 8 ++++++++
crates/gpui/src/gpui.rs     | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)

Detailed changes

crates/gpui/src/geometry.rs 🔗

@@ -1,3 +1,7 @@
+//! The GPUI geometry module is a collection of types and traits that
+//! can be used to describe common units, concepts, and the relationships
+//! between them.
+
 use core::fmt::Debug;
 use derive_more::{Add, AddAssign, Div, DivAssign, Mul, Neg, Sub, SubAssign};
 use refineable::Refineable;
@@ -8,13 +12,17 @@ use std::{
     ops::{Add, Div, Mul, MulAssign, Sub},
 };
 
+/// An axis along which a measurement can be made.
 #[derive(Copy, Clone, PartialEq, Eq, Debug)]
 pub enum Axis {
+    /// The y axis, or up and down
     Vertical,
+    /// The x axis, or left and right
     Horizontal,
 }
 
 impl Axis {
+    /// Swap this axis to the opposite axis.
     pub fn invert(&self) -> Self {
         match self {
             Axis::Vertical => Axis::Horizontal,

crates/gpui/src/gpui.rs 🔗

@@ -26,7 +26,7 @@
 //! TODO!(docs): Wrap up with a conclusion and links to other places? Zed / GPUI website?
 //! Discord for chatting about it? Other tutorials or references?
 
-// #![deny(missing_docs)]
+#![deny(missing_docs)]
 #![allow(clippy::type_complexity)]
 
 #[macro_use]