Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5f3c8ef

Browse files
Add PartialEq and PartialOrd impls for comparing String and &String
This makes such comparisons more robust against the availability of other impls.
1 parent 96492ea commit 5f3c8ef

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

‎library/alloc/src/string.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2531,6 +2531,7 @@ macro_rules! impl_eq {
25312531

25322532
impl_eq! { String, str }
25332533
impl_eq! { String, &'a str }
2534+
impl_eq! { String, &String }
25342535
impl_eq! { &String, str }
25352536
#[cfg(not(no_global_oom_handling))]
25362537
impl_eq! { Cow<'a, str>, str }
@@ -2566,6 +2567,7 @@ macro_rules! impl_ord {
25662567
impl_ord! { String, str }
25672568
impl_ord! { String, &'a str }
25682569
impl_ord! { &String, str }
2570+
impl_ord! { String, &String }
25692571
#[cfg(not(no_global_oom_handling))]
25702572
impl_ord! { Cow<'a, str>, str }
25712573
#[cfg(not(no_global_oom_handling))]

‎src/bootstrap/src/core/build_steps/clippy.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ pub fn get_clippy_rules_in_order(all_args: &[String], config: &LintConfig) -> Ve
7777
let rule = format!("{prefix}{v}");
7878
// Arguments added by bootstrap in LintConfig won't show up in the all_args list, so
7979
// put them at the end of the command line.
80-
let position = all_args.iter().position(|t| t == &rule || t == v).unwrap_or(usize::MAX);
80+
let position =
81+
all_args.iter().position(|t| t == rule.as_str() || t == v).unwrap_or(usize::MAX);
8182
result.push((position, rule));
8283
});
8384
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /