diff options
author | Yuri Astrakhan <yuriastrakhan@gmail.com> | 2023-10-22 22:29:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-22 22:29:03 -0400 |
commit | 1e16456d5f7bedc9dfc1148991353011243831cf (patch) | |
tree | f8c9e93d6510f23c8131358439238a62e3704fdc /src/utils | |
parent | 4174012b8f14cbf92536c103c924b280e7a53b58 (diff) |
chore: Minor cleanup - remove un-needed ident qualifiers (#1307)
Keep code a bit tidier and consistent (i.e. if an identifier already has a `use` entry above, why in some cases still prove a full path to it?)
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/error.rs | 4 | ||||
-rw-r--r-- | src/utils/gen_util.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/error.rs b/src/utils/error.rs index bf6a5b38..74fdbe69 100644 --- a/src/utils/error.rs +++ b/src/utils/error.rs @@ -48,8 +48,8 @@ impl From<std::num::ParseIntError> for BottomError { } } -impl From<std::string::String> for BottomError { - fn from(err: std::string::String) -> Self { +impl From<String> for BottomError { + fn from(err: String) -> Self { BottomError::GenericError(err) } } diff --git a/src/utils/gen_util.rs b/src/utils/gen_util.rs index 946cb3cd..b71efc0c 100644 --- a/src/utils/gen_util.rs +++ b/src/utils/gen_util.rs @@ -178,7 +178,7 @@ fn truncate_str<U: Into<usize>>(content: &str, width: U) -> String { } #[inline] -pub const fn sort_partial_fn<T: std::cmp::PartialOrd>(is_descending: bool) -> fn(T, T) -> Ordering { +pub const fn sort_partial_fn<T: PartialOrd>(is_descending: bool) -> fn(T, T) -> Ordering { if is_descending { partial_ordering_desc } else { @@ -188,7 +188,7 @@ pub const fn sort_partial_fn<T: std::cmp::PartialOrd>(is_descending: bool) -> fn /// Returns an [`Ordering`] between two [`PartialOrd`]s. #[inline] -pub fn partial_ordering<T: std::cmp::PartialOrd>(a: T, b: T) -> Ordering { +pub fn partial_ordering<T: PartialOrd>(a: T, b: T) -> Ordering { a.partial_cmp(&b).unwrap_or(Ordering::Equal) } @@ -197,7 +197,7 @@ pub fn partial_ordering<T: std::cmp::PartialOrd>(a: T, b: T) -> Ordering { /// This is simply a wrapper function around [`partial_ordering`] that reverses /// the result. #[inline] -pub fn partial_ordering_desc<T: std::cmp::PartialOrd>(a: T, b: T) -> Ordering { +pub fn partial_ordering_desc<T: PartialOrd>(a: T, b: T) -> Ordering { partial_ordering(a, b).reverse() } |