File tree Expand file tree Collapse file tree 2 files changed +17
-16
lines changed Expand file tree Collapse file tree 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;
3131use crate :: util:: toml_mut:: dependency:: PathSource ;
3232use crate :: util:: toml_mut:: dependency:: Source ;
3333use crate :: util:: toml_mut:: dependency:: WorkspaceSource ;
34+ use crate :: util:: toml_mut:: is_sorted;
3435use crate :: util:: toml_mut:: manifest:: DepTable ;
3536use crate :: util:: toml_mut:: manifest:: LocalManifest ;
3637use crate :: util:: RustVersion ;
@@ -1004,22 +1005,6 @@ fn format_features_version_suffix(dep: &DependencyUI) -> String {
10041005 }
10051006}
10061007
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-
10231008fn find_workspace_dep ( toml_key : & str , root_manifest : & Path ) -> CargoResult < Dependency > {
10241009 let manifest = LocalManifest :: try_new ( root_manifest) ?;
10251010 let manifest = manifest
Original file line number Diff line number Diff line change 1111
1212pub mod dependency;
1313pub 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