From d0ea0765aa76b7e9ea146e86db1d24e9b17443ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Tue, 26 May 2020 22:12:10 +0200 Subject: [PATCH] Use crate visibility for traits (#358) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tomasz Miąsko --- src/float/mod.rs | 2 +- src/int/mod.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/float/mod.rs b/src/float/mod.rs index 8b80394..06e9aad 100644 --- a/src/float/mod.rs +++ b/src/float/mod.rs @@ -13,7 +13,7 @@ pub mod pow; pub mod sub; /// Trait for some basic operations on floats -pub trait Float: +pub(crate) trait Float: Copy + PartialEq + PartialOrd diff --git a/src/int/mod.rs b/src/int/mod.rs index 80ac4f9..d73bf6d 100644 --- a/src/int/mod.rs +++ b/src/int/mod.rs @@ -19,7 +19,7 @@ pub mod shift; pub mod udiv; /// Trait for some basic operations on integers -pub trait Int: +pub(crate) trait Int: Copy + PartialEq + PartialOrd @@ -190,7 +190,7 @@ int_impl!(i64, u64, 64); int_impl!(i128, u128, 128); /// Trait to convert an integer to/from smaller parts -pub trait LargeInt: Int { +pub(crate) trait LargeInt: Int { type LowHalf: Int; type HighHalf: Int; @@ -232,7 +232,7 @@ large_int!(u128, u64, u64, 64); large_int!(i128, u64, i64, 64); /// Trait to express (possibly lossy) casting of integers -pub trait CastInto: Copy { +pub(crate) trait CastInto: Copy { fn cast(self) -> T; } @@ -256,7 +256,7 @@ cast_into!(i64); cast_into!(u128); cast_into!(i128); -pub trait WideInt: Int { +pub(crate) trait WideInt: Int { type Output: Int; fn wide_mul(self, other: Self) -> (Self, Self);