mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Remove cast to usize for BytePos and CharPos
The case shouldn't be necessary and implicitly truncating BytePos is not desirable.
This commit is contained in:
parent
b4b4a2f092
commit
9a1f1777d3
@ -1596,7 +1596,7 @@ macro_rules! impl_pos {
|
||||
|
||||
#[inline(always)]
|
||||
fn add(self, rhs: $ident) -> $ident {
|
||||
$ident((self.to_usize() + rhs.to_usize()) as $inner_ty)
|
||||
$ident(self.0 + rhs.0)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1605,7 +1605,7 @@ macro_rules! impl_pos {
|
||||
|
||||
#[inline(always)]
|
||||
fn sub(self, rhs: $ident) -> $ident {
|
||||
$ident((self.to_usize() - rhs.to_usize()) as $inner_ty)
|
||||
$ident(self.0 - rhs.0)
|
||||
}
|
||||
}
|
||||
)*
|
||||
|
Loading…
Reference in New Issue
Block a user