Skip to content

Commit

Permalink
all: remove inconsistent ::core use
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Oct 28, 2024
1 parent 4ee91fa commit b9fca9a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions crates/rune-alloc/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ use crate::vec::Vec;
#[test]
fn ensure_niche_size() {
assert_eq!(
::core::mem::size_of::<Option<Box<u32>>>(),
::core::mem::size_of::<Box<u32>>()
core::mem::size_of::<Option<Box<u32>>>(),
core::mem::size_of::<Box<u32>>()
);
}

Expand Down
28 changes: 14 additions & 14 deletions crates/rune-alloc/src/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,23 @@ impl_copy!(i128);
impl_copy!(f32);
impl_copy!(f64);

impl_copy!(::core::num::NonZeroUsize);
impl_copy!(::core::num::NonZeroIsize);
impl_copy!(::core::num::NonZeroU8);
impl_copy!(::core::num::NonZeroU16);
impl_copy!(::core::num::NonZeroU32);
impl_copy!(::core::num::NonZeroU64);
impl_copy!(::core::num::NonZeroU128);
impl_copy!(::core::num::NonZeroI8);
impl_copy!(::core::num::NonZeroI16);
impl_copy!(::core::num::NonZeroI32);
impl_copy!(::core::num::NonZeroI64);
impl_copy!(::core::num::NonZeroI128);
impl_copy!(core::num::NonZeroUsize);
impl_copy!(core::num::NonZeroIsize);
impl_copy!(core::num::NonZeroU8);
impl_copy!(core::num::NonZeroU16);
impl_copy!(core::num::NonZeroU32);
impl_copy!(core::num::NonZeroU64);
impl_copy!(core::num::NonZeroU128);
impl_copy!(core::num::NonZeroI8);
impl_copy!(core::num::NonZeroI16);
impl_copy!(core::num::NonZeroI32);
impl_copy!(core::num::NonZeroI64);
impl_copy!(core::num::NonZeroI128);

#[cfg(feature = "std")]
impl_copy!(::std::process::ExitStatus);

impl<T, E> TryClone for ::core::result::Result<T, E>
impl<T, E> TryClone for core::result::Result<T, E>
where
T: TryClone,
E: TryClone,
Expand All @@ -148,7 +148,7 @@ where
}
}

impl<T> TryClone for ::core::option::Option<T>
impl<T> TryClone for core::option::Option<T>
where
T: TryClone,
{
Expand Down
4 changes: 2 additions & 2 deletions crates/rune-core/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ define! {
/// Note that it uses the `Result` like [`Try`] uses [`ControlFlow`] i.e.,
/// for `Result::<T, E>` it should return `Result<T, Result<(), E>>`
///
/// [`Try`]: ::core::ops::Try
/// [`ControlFlow`]: ::core::ops::ControlFlow
/// [`Try`]: core::ops::Try
/// [`ControlFlow`]: core::ops::ControlFlow
pub const [TRY, TRY_HASH]: Protocol = Protocol {
name: "try",
hash: 0x5da1a80787003354u64,
Expand Down
4 changes: 2 additions & 2 deletions crates/rune/src/compile/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ impl core::error::Error for Error {
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
::core::fmt::Display::fmt(&self.kind, f)
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(&self.kind, f)
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/rune/src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ mod compile;
pub(crate) use self::compile::compile;

/// Helper alias for compile results.
pub type Result<T, E = Error> = ::core::result::Result<T, E>;
pub type Result<T, E = Error> = core::result::Result<T, E>;
12 changes: 6 additions & 6 deletions crates/rune/src/runtime/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ macro_rules! range_iter {
$ty: $crate::runtime::FromValue + $crate::runtime::ToValue,
$ty: $crate::runtime::MaybeTypeOf + $crate::runtime::TypeOf,
{
iter: ::core::ops::$range<$ty>,
iter: core::ops::$range<$ty>,
}

impl<$ty> $name<$ty>
Expand All @@ -18,10 +18,10 @@ macro_rules! range_iter {
$ty: $crate::compile::Named,
$ty: $crate::runtime::FromValue + $crate::runtime::ToValue,
$ty: $crate::runtime::MaybeTypeOf + $crate::runtime::TypeOf,
::core::ops::$range<$ty>: Iterator<Item = $ty>,
core::ops::$range<$ty>: Iterator<Item = $ty>,
{
#[inline]
pub(crate) fn new(iter: ::core::ops::$range<$ty>) -> Self {
pub(crate) fn new(iter: core::ops::$range<$ty>) -> Self {
Self { iter }
}

Expand All @@ -40,7 +40,7 @@ macro_rules! range_iter {
$ty: $crate::compile::Named,
$ty: $crate::runtime::FromValue + $crate::runtime::ToValue,
$ty: $crate::runtime::MaybeTypeOf + $crate::runtime::TypeOf,
::core::ops::$range<$ty>: Iterator<Item = $ty>,
core::ops::$range<$ty>: Iterator<Item = $ty>,
{
type Item = $ty;

Expand All @@ -62,7 +62,7 @@ macro_rules! double_ended_range_iter {
T: $crate::compile::Named,
T: $crate::runtime::FromValue + $crate::runtime::ToValue,
T: $crate::runtime::MaybeTypeOf + $crate::runtime::TypeOf,
::core::ops::$range<T>: DoubleEndedIterator<Item = T>,
core::ops::$range<T>: DoubleEndedIterator<Item = T>,
{
#[rune::function(instance, keep, protocol = NEXT_BACK)]
#[inline]
Expand All @@ -77,7 +77,7 @@ macro_rules! double_ended_range_iter {
T: $crate::compile::Named,
T: $crate::runtime::FromValue + $crate::runtime::ToValue,
T: $crate::runtime::MaybeTypeOf + $crate::runtime::TypeOf,
::core::ops::$range<T>: DoubleEndedIterator<Item = T>,
core::ops::$range<T>: DoubleEndedIterator<Item = T>,
{
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion crates/rune/src/support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub(crate) mod no_std {
///
/// For errors which aren't automatically captures, you should map them
/// using [`Error::msg`].
pub type Result<T, E = Error> = ::core::result::Result<T, E>;
pub type Result<T, E = Error> = core::result::Result<T, E>;

/// Error kind which supports capturing any toplevel errors produced by
/// Rune.
Expand Down

0 comments on commit b9fca9a

Please sign in to comment.