Skip to content

Commit

Permalink
fixed format manually since x.py fmt did not work
Browse files Browse the repository at this point in the history
  • Loading branch information
michirakara committed Nov 8, 2024
1 parent 67b0560 commit 921451d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_index_macros/src/newtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl Parse for Newtype {
#gate_rustc_only
impl ::std::iter::Step for #name {
#[inline]
fn steps_between(start: &Self, end: &Self) -> (usize,Option<usize>) {
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
<usize as ::std::iter::Step>::steps_between(
&Self::index(*start),
&Self::index(*end),
Expand Down
18 changes: 9 additions & 9 deletions library/core/src/iter/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ macro_rules! step_integer_impls {
step_signed_methods!($u_narrower);

#[inline]
fn steps_between(start: &Self, end: &Self) -> (usize,Option<usize>) {
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
if *start <= *end {
// This relies on $i_narrower <= usize
//
Expand All @@ -303,7 +303,7 @@ macro_rules! step_integer_impls {
let steps = (*end as isize).wrapping_sub(*start as isize) as usize;
(steps, Some(steps))
} else {
(0,None)
(0, None)
}
}

Expand Down Expand Up @@ -359,15 +359,15 @@ macro_rules! step_integer_impls {
step_unsigned_methods!();

#[inline]
fn steps_between(start: &Self, end: &Self) -> (usize,Option<usize>) {
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
if *start <= *end {
if let Ok(steps) = usize::try_from(*end - *start) {
(steps,Some(steps))
(steps, Some(steps))
}else{
(usize::MAX,None)
(usize::MAX, None)
}
} else {
(0,None)
(0, None)
}
}

Expand All @@ -389,12 +389,12 @@ macro_rules! step_integer_impls {
step_signed_methods!($u_wider);

#[inline]
fn steps_between(start: &Self, end: &Self) -> (usize,Option<usize>) {
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
if *start <= *end {
match end.checked_sub(*start) {
Some(result) => {
if let Ok(steps) = usize::try_from(result) {
(steps,Some(steps))
(steps, Some(steps))
}else{
(usize::MAX, None)
}
Expand All @@ -404,7 +404,7 @@ macro_rules! step_integer_impls {
None => (usize::MAX, None),
}
} else {
(0,None)
(0, None)
}
}

Expand Down

0 comments on commit 921451d

Please sign in to comment.