File tree 2 files changed +17
-16
lines changed
2 files changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ use crate::util::toml_mut::dependency::MaybeWorkspace;
31
31
use crate :: util:: toml_mut:: dependency:: PathSource ;
32
32
use crate :: util:: toml_mut:: dependency:: Source ;
33
33
use crate :: util:: toml_mut:: dependency:: WorkspaceSource ;
34
+ use crate :: util:: toml_mut:: is_sorted;
34
35
use crate :: util:: toml_mut:: manifest:: DepTable ;
35
36
use crate :: util:: toml_mut:: manifest:: LocalManifest ;
36
37
use crate :: util:: RustVersion ;
@@ -1004,22 +1005,6 @@ fn format_features_version_suffix(dep: &DependencyUI) -> String {
1004
1005
}
1005
1006
}
1006
1007
1007
- // Based on Iterator::is_sorted from nightly std; remove in favor of that when stabilized.
1008
- fn is_sorted ( mut it : impl Iterator < Item = impl PartialOrd > ) -> bool {
1009
- let Some ( mut last) = it. next ( ) else {
1010
- return true ;
1011
- } ;
1012
-
1013
- for curr in it {
1014
- if curr < last {
1015
- return false ;
1016
- }
1017
- last = curr;
1018
- }
1019
-
1020
- true
1021
- }
1022
-
1023
1008
fn find_workspace_dep ( toml_key : & str , root_manifest : & Path ) -> CargoResult < Dependency > {
1024
1009
let manifest = LocalManifest :: try_new ( root_manifest) ?;
1025
1010
let manifest = manifest
Original file line number Diff line number Diff line change 11
11
12
12
pub mod dependency;
13
13
pub mod manifest;
14
+
15
+ // Based on Iterator::is_sorted from nightly std; remove in favor of that when stabilized.
16
+ pub fn is_sorted ( mut it : impl Iterator < Item = impl PartialOrd > ) -> bool {
17
+ let Some ( mut last) = it. next ( ) else {
18
+ return true ;
19
+ } ;
20
+
21
+ for curr in it {
22
+ if curr < last {
23
+ return false ;
24
+ }
25
+ last = curr;
26
+ }
27
+
28
+ true
29
+ }
You can’t perform that action at this time.
0 commit comments