From 87c3913a42c05b53227eeb24a8e8238caef3c5d1 Mon Sep 17 00:00:00 2001 From: blyxyas Date: Thu, 23 May 2024 18:45:03 +0200 Subject: [PATCH 1/2] Make clamp inline --- core/src/cmp.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/cmp.rs b/core/src/cmp.rs index fc6022ab75357..f3f757ce69df7 100644 --- a/core/src/cmp.rs +++ b/core/src/cmp.rs @@ -898,6 +898,7 @@ pub trait Ord: Eq + PartialOrd { /// assert_eq!(2.clamp(-2, 1), 1); /// ``` #[must_use] + #[inline] #[stable(feature = "clamp", since = "1.50.0")] fn clamp(self, min: Self, max: Self) -> Self where From 6fbd5f4643a88ff9a2d644f071a6537068ad5705 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 24 May 2024 15:08:18 +1000 Subject: [PATCH 2/2] Run rustfmt on files that need it. Somehow these files aren't properly formatted. By default `x fmt` and `x tidy` only check files that have changed against master, so if an ill-formatted file somehow slips in it can stay that way as long as it doesn't get modified(?) I found these when I ran `x fmt` explicitly on every `.rs` file in the repo, while working on https://github.com/rust-lang/compiler-team/issues/750. --- test/src/bench.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/src/bench.rs b/test/src/bench.rs index 9a5dc351f6d07..64ca13c0d4ed3 100644 --- a/test/src/bench.rs +++ b/test/src/bench.rs @@ -98,7 +98,7 @@ fn fmt_thousands_sep(mut n: f64, sep: char) -> String { (0, true) => write!(output, "{:06.2}", n / base as f64).unwrap(), (0, false) => write!(output, "{:.2}", n / base as f64).unwrap(), (_, true) => write!(output, "{:03}", n as usize / base).unwrap(), - _ => write!(output, "{}", n as usize / base).unwrap() + _ => write!(output, "{}", n as usize / base).unwrap(), } if pow != 0 { output.push(sep);