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:
parent
d50905e000
commit
dc64ec9cc8
802 changed files with 3775 additions and 3662 deletions
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue