Skip to content

Commit 95d41dc

Browse files
author
bors-servo
authored
Auto merge of #199 - nical:mod-exports, r=kvark
Re-export all euclid types and hide the module hierarchy. There was a mix between things that were reexported in lib.rs (most types) all of which were also accessible through their modules (you get to choose between euclid::Bar and euclid::foo::Bar), and a few that were public but only accessible in sub modules. Let's clean this up and export everything public in lib.rs. A nice side effect of this is that it makes it possible to export the function euclid::rect which was otherwise clashing with the module euclid::rect. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/euclid/199) <!-- Reviewable:end -->
2 parents 13b3ddc + 6610d5f commit 95d41dc

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/lib.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,33 +72,33 @@ pub use scale_factor::ScaleFactor;
7272
pub use transform2d::{Transform2D, TypedTransform2D};
7373
pub use transform3d::{Transform3D, TypedTransform3D};
7474
pub use point::{
75-
Point2D, TypedPoint2D,
76-
Point3D, TypedPoint3D,
75+
Point2D, TypedPoint2D, point2,
76+
Point3D, TypedPoint3D, point3,
7777
};
7878
pub use vector::{
79-
Vector2D, TypedVector2D,
80-
Vector3D, TypedVector3D,
79+
Vector2D, TypedVector2D, vec2,
80+
Vector3D, TypedVector3D, vec3,
8181
};
8282

83-
pub use rect::{Rect, TypedRect};
83+
pub use rect::{Rect, TypedRect, rect};
8484
pub use side_offsets::{SideOffsets2D, TypedSideOffsets2D};
8585
#[cfg(feature = "unstable")] pub use side_offsets::SideOffsets2DSimdI32;
86-
pub use size::{Size2D, TypedSize2D};
86+
pub use size::{Size2D, TypedSize2D, size2};
8787

8888
pub mod approxeq;
89-
pub mod length;
89+
pub mod num;
90+
mod length;
9091
#[macro_use]
9192
mod macros;
92-
pub mod transform2d;
93-
pub mod transform3d;
94-
pub mod num;
95-
pub mod point;
96-
pub mod rect;
97-
pub mod scale_factor;
98-
pub mod side_offsets;
99-
pub mod size;
100-
pub mod trig;
101-
pub mod vector;
93+
mod transform2d;
94+
mod transform3d;
95+
mod point;
96+
mod rect;
97+
mod scale_factor;
98+
mod side_offsets;
99+
mod size;
100+
mod trig;
101+
mod vector;
102102

103103
/// The default unit.
104104
#[derive(Clone, Copy)]

src/scale_factor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ use std::marker::PhantomData;
2626
/// may be types without values, such as empty enums. For example:
2727
///
2828
/// ```rust
29-
/// use euclid::scale_factor::ScaleFactor;
30-
/// use euclid::length::Length;
29+
/// use euclid::ScaleFactor;
30+
/// use euclid::Length;
3131
/// enum Mm {};
3232
/// enum Inch {};
3333
///

0 commit comments

Comments
 (0)