Rename `foo/mod.rs` files too `foo.rs`

Max Brunsfeld and Nathan Sobo created

Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Change summary

gpui/src/elements.rs          | 54 ++++++++++++++++++++++++++++++++++-
gpui/src/elements/mod.rs      | 56 -------------------------------------
gpui/src/platform.rs          |  0 
gpui/src/platform/mac.rs      |  0 
zed/src/editor.rs             |  0 
zed/src/editor/buffer.rs      |  0 
zed/src/editor/display_map.rs |  0 
zed/src/sum_tree.rs           |  0 
8 files changed, 52 insertions(+), 58 deletions(-)

Detailed changes

gpui/src/elements/new.rs → gpui/src/elements.rs 🔗

@@ -1,7 +1,36 @@
+mod align;
+mod canvas;
+mod constrained_box;
+mod container;
+mod empty;
+mod event_handler;
+mod flex;
+mod label;
+mod line_box;
+mod mouse_event_handler;
+mod stack;
+mod svg;
+mod uniform_list;
+
+pub use crate::presenter::ChildView;
+pub use align::*;
+pub use canvas::*;
+pub use constrained_box::*;
+pub use container::*;
+pub use empty::*;
+pub use event_handler::*;
+pub use flex::*;
+pub use label::*;
+pub use line_box::*;
+pub use mouse_event_handler::*;
+pub use stack::*;
+pub use svg::*;
+pub use uniform_list::*;
+
 use crate::{
     geometry::{rect::RectF, vector::Vector2F},
-    json, AfterLayoutContext, DebugContext, Event, EventContext, LayoutContext, PaintContext,
-    SizeConstraint,
+    json, AfterLayoutContext, AppContext, DebugContext, Event, EventContext, LayoutContext,
+    PaintContext, SizeConstraint,
 };
 use core::panic;
 use json::ToJson;
@@ -268,3 +297,24 @@ impl ElementBox {
         value
     }
 }
+
+pub trait ParentElement<'a>: Extend<ElementBox> + Sized {
+    fn add_children(&mut self, children: impl IntoIterator<Item = ElementBox>) {
+        self.extend(children);
+    }
+
+    fn add_child(&mut self, child: ElementBox) {
+        self.add_children(Some(child));
+    }
+
+    fn with_children(mut self, children: impl IntoIterator<Item = ElementBox>) -> Self {
+        self.add_children(children);
+        self
+    }
+
+    fn with_child(self, child: ElementBox) -> Self {
+        self.with_children(Some(child))
+    }
+}
+
+impl<'a, T> ParentElement<'a> for T where T: Extend<ElementBox> {}

gpui/src/elements/mod.rs 🔗

@@ -1,56 +0,0 @@
-mod align;
-mod canvas;
-mod constrained_box;
-mod container;
-mod empty;
-mod event_handler;
-mod flex;
-mod label;
-mod line_box;
-mod mouse_event_handler;
-mod new;
-mod stack;
-mod svg;
-mod uniform_list;
-
-pub use crate::presenter::ChildView;
-pub use align::*;
-pub use canvas::*;
-pub use constrained_box::*;
-pub use container::*;
-pub use empty::*;
-pub use event_handler::*;
-pub use flex::*;
-pub use label::*;
-pub use line_box::*;
-pub use mouse_event_handler::*;
-pub use new::*;
-pub use stack::*;
-pub use svg::*;
-pub use uniform_list::*;
-
-use crate::{
-    AfterLayoutContext, AppContext, Event, EventContext, LayoutContext, PaintContext,
-    SizeConstraint,
-};
-
-pub trait ParentElement<'a>: Extend<ElementBox> + Sized {
-    fn add_children(&mut self, children: impl IntoIterator<Item = ElementBox>) {
-        self.extend(children);
-    }
-
-    fn add_child(&mut self, child: ElementBox) {
-        self.add_children(Some(child));
-    }
-
-    fn with_children(mut self, children: impl IntoIterator<Item = ElementBox>) -> Self {
-        self.add_children(children);
-        self
-    }
-
-    fn with_child(self, child: ElementBox) -> Self {
-        self.with_children(Some(child))
-    }
-}
-
-impl<'a, T> ParentElement<'a> for T where T: Extend<ElementBox> {}