Skip to content

Commit 29e9a1c

Browse files
authored
removed (#14370)
1 parent 0edc3d9 commit 29e9a1c

File tree

1 file changed

+0
-26
lines changed
  • datafusion/common/src/utils

1 file changed

+0
-26
lines changed

datafusion/common/src/utils/mod.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -769,20 +769,6 @@ pub fn set_difference<T: Borrow<usize>, S: Borrow<usize>>(
769769
.collect()
770770
}
771771

772-
/// Checks whether the given index sequence is monotonically non-decreasing.
773-
pub fn is_sorted<T: Borrow<usize>>(sequence: impl IntoIterator<Item = T>) -> bool {
774-
// TODO: Remove this function when `is_sorted` graduates from Rust nightly.
775-
let mut previous = 0;
776-
for item in sequence.into_iter() {
777-
let current = *item.borrow();
778-
if current < previous {
779-
return false;
780-
}
781-
previous = current;
782-
}
783-
true
784-
}
785-
786772
/// Find indices of each element in `targets` inside `items`. If one of the
787773
/// elements is absent in `items`, returns an error.
788774
pub fn find_indices<T: PartialEq, S: Borrow<T>>(
@@ -1171,18 +1157,6 @@ mod tests {
11711157
assert_eq!(set_difference([3, 4, 0], [4, 1, 2]), vec![3, 0]);
11721158
}
11731159

1174-
#[test]
1175-
fn test_is_sorted() {
1176-
assert!(is_sorted::<usize>([]));
1177-
assert!(is_sorted([0]));
1178-
assert!(is_sorted([0, 3, 4]));
1179-
assert!(is_sorted([0, 1, 2]));
1180-
assert!(is_sorted([0, 1, 4]));
1181-
assert!(is_sorted([0usize; 0]));
1182-
assert!(is_sorted([1, 2]));
1183-
assert!(!is_sorted([3, 2]));
1184-
}
1185-
11861160
#[test]
11871161
fn test_find_indices() -> Result<()> {
11881162
assert_eq!(find_indices(&[0, 3, 4], [0, 3, 4])?, vec![0, 1, 2]);

0 commit comments

Comments
 (0)