about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2025-03-30 10:35:59 +0200
committerMara Bos <m-ou.se@m-ou.se>2025-03-30 10:42:00 +0200
commitcc5ee70b1a51bf30e85d261cc6e485eb3431bcac (patch)
treeb4f0a08745c3211f06070f0ce065b38bb1cfba81 /library
parent5cc60728e7ee10eb2ae5f61f7d412d9805b22f0c (diff)
downloadrust-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')
-rw-r--r--library/core/src/fmt/rt.rs8
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)]