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
1 changed files with 2 additions and 2 deletions
|
@ -1596,7 +1596,7 @@ macro_rules! impl_pos {
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn add(self, rhs: $ident) -> $ident {
|
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)]
|
#[inline(always)]
|
||||||
fn sub(self, rhs: $ident) -> $ident {
|
fn sub(self, rhs: $ident) -> $ident {
|
||||||
$ident((self.to_usize() - rhs.to_usize()) as $inner_ty)
|
$ident(self.0 - rhs.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)*
|
)*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue