Rust 1.85 (#25272)
Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ... --------- Co-authored-by: Anthony Eid <hello@anthonyeid.me>
This commit is contained in:
parent
fc52b43159
commit
e4e758db3a
68 changed files with 180 additions and 190 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue