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
co-authored by Anthony Eid
parent fc52b43159
commit e4e758db3a
68 changed files with 180 additions and 190 deletions
+3 -3
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;