chore: Bump Rust edition to 2024 (#27800)

Follow-up to https://github.com/zed-industries/zed/pull/27791

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-03-31 20:55:27 +02:00 committed by GitHub
parent d50905e000
commit dc64ec9cc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
802 changed files with 3775 additions and 3662 deletions

View file

@ -1,7 +1,7 @@
use std::ops::Range;
use criterion::{
black_box, criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion, Throughput,
BatchSize, BenchmarkId, Criterion, Throughput, black_box, criterion_group, criterion_main,
};
use rand::prelude::*;
use rand::rngs::StdRng;

View file

@ -1428,10 +1428,10 @@ where
#[cfg(test)]
mod tests {
use super::*;
use Bias::{Left, Right};
use rand::prelude::*;
use std::{cmp::Ordering, env, io::Read};
use util::RandomCharIter;
use Bias::{Left, Right};
#[ctor::ctor]
fn init_logger() {
@ -1900,12 +1900,14 @@ mod tests {
let correct_substring = &text[start..end];
// Test that correct range returns true
assert!(rope
.chunks_in_range(range.clone())
.equals_str(correct_substring));
assert!(rope
.reversed_chunks_in_range(range.clone())
.equals_str(correct_substring));
assert!(
rope.chunks_in_range(range.clone())
.equals_str(correct_substring)
);
assert!(
rope.reversed_chunks_in_range(range.clone())
.equals_str(correct_substring)
);
// Test that all other ranges return false (unless they happen to match)
for other_start in 0..text.len() {
@ -1919,12 +1921,16 @@ mod tests {
if other_substring == correct_substring {
continue;
}
assert!(!rope
.chunks_in_range(range.clone())
.equals_str(other_substring));
assert!(!rope
.reversed_chunks_in_range(range.clone())
.equals_str(other_substring));
assert!(
!rope
.chunks_in_range(range.clone())
.equals_str(other_substring)
);
assert!(
!rope
.reversed_chunks_in_range(range.clone())
.equals_str(other_substring)
);
}
}
}