Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
This commit is contained in:
Piotr Osiewicz 2025-02-28 18:33:35 +01:00 committed by GitHub
parent fc52b43159
commit e4e758db3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 180 additions and 190 deletions

View file

@ -78,7 +78,7 @@ pub struct ChunkSlice<'a> {
text: &'a str,
}
impl<'a> Into<Chunk> for ChunkSlice<'a> {
impl Into<Chunk> for ChunkSlice<'_> {
fn into(self) -> Chunk {
Chunk {
chars: self.chars,

View file

@ -124,8 +124,8 @@ impl PartialOrd for Point {
impl Ord for Point {
#[cfg(target_pointer_width = "64")]
fn cmp(&self, other: &Point) -> Ordering {
let a = (self.row as usize) << 32 | self.column as usize;
let b = (other.row as usize) << 32 | other.column as usize;
let a = ((self.row as usize) << 32) | self.column as usize;
let b = ((other.row as usize) << 32) | other.column as usize;
a.cmp(&b)
}

View file

@ -104,8 +104,8 @@ impl PartialOrd for PointUtf16 {
impl Ord for PointUtf16 {
#[cfg(target_pointer_width = "64")]
fn cmp(&self, other: &PointUtf16) -> Ordering {
let a = (self.row as usize) << 32 | self.column as usize;
let b = (other.row as usize) << 32 | other.column as usize;
let a = ((self.row as usize) << 32) | self.column as usize;
let b = ((other.row as usize) << 32) | other.column as usize;
a.cmp(&b)
}

View file

@ -145,7 +145,7 @@ impl Rope {
// We also round up the capacity up by one, for a good measure; we *really* don't want to realloc here, as we assume that the # of characters
// we're working with there is large.
let capacity = (text.len() + MIN_CHUNK_SIZE - 1) / MIN_CHUNK_SIZE;
let capacity = text.len().div_ceil(MIN_CHUNK_SIZE);
let mut new_chunks = Vec::with_capacity(capacity);
while !text.is_empty() {
@ -855,7 +855,7 @@ impl<'a> Iterator for Bytes<'a> {
}
}
impl<'a> io::Read for Bytes<'a> {
impl io::Read for Bytes<'_> {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
if let Some(chunk) = self.peek() {
let len = cmp::min(buf.len(), chunk.len());
@ -889,7 +889,7 @@ pub struct Lines<'a> {
reversed: bool,
}
impl<'a> Lines<'a> {
impl Lines<'_> {
pub fn next(&mut self) -> Option<&str> {
if self.done {
return None;