diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2025-03-30 10:35:59 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2025-03-30 10:42:00 +0200 |
| commit | cc5ee70b1a51bf30e85d261cc6e485eb3431bcac (patch) | |
| tree | b4f0a08745c3211f06070f0ce065b38bb1cfba81 /library/core/src | |
| parent | 5cc60728e7ee10eb2ae5f61f7d412d9805b22f0c (diff) | |
| download | rust-cc5ee70b1a51bf30e85d261cc6e485eb3431bcac.tar.gz rust-cc5ee70b1a51bf30e85d261cc6e485eb3431bcac.zip | |
Simplify expansion for format_args!().
Instead of calling new(), we can just use a struct expression directly.
Before:
Placeholder::new(…, …, …, …)
After:
Placeholder {
position: …,
flags: …,
width: …,
precision: …,
}
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/fmt/rt.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/library/core/src/fmt/rt.rs b/library/core/src/fmt/rt.rs index d27f7e6e0d8..0b04ebccae2 100644 --- a/library/core/src/fmt/rt.rs +++ b/library/core/src/fmt/rt.rs @@ -20,8 +20,8 @@ pub struct Placeholder { pub width: Count, } +#[cfg(bootstrap)] impl Placeholder { - #[cfg(bootstrap)] #[inline] pub const fn new( position: usize, @@ -33,12 +33,6 @@ impl Placeholder { ) -> Self { Self { position, fill, align, flags, precision, width } } - - #[cfg(not(bootstrap))] - #[inline] - pub const fn new(position: usize, flags: u32, precision: Count, width: Count) -> Self { - Self { position, flags, precision, width } - } } #[cfg(bootstrap)] |
