about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2023-04-20 18:07:34 +0200
committerMara Bos <m-ou.se@m-ou.se>2023-04-20 18:07:34 +0200
commitbca80d811c44998e99014c4f85c1130c26cd9dd3 (patch)
treeb442580e47618549afe82afcd725ea7ad89340d3
parent938efe6f498b24734e68647aefb1e17459ef49b2 (diff)
downloadrust-bca80d811c44998e99014c4f85c1130c26cd9dd3.tar.gz
rust-bca80d811c44998e99014c4f85c1130c26cd9dd3.zip
Get rid of core::fmt::FormatSpec.
-rw-r--r--library/core/src/fmt/mod.rs10
-rw-r--r--library/core/src/fmt/rt.rs7
2 files changed, 6 insertions, 11 deletions
diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs
index bbbfe06656c..de958a82d96 100644
--- a/library/core/src/fmt/mod.rs
+++ b/library/core/src/fmt/mod.rs
@@ -1277,14 +1277,14 @@ pub fn write(output: &mut dyn Write, args: Arguments<'_>) -> Result {
 }
 
 unsafe fn run(fmt: &mut Formatter<'_>, arg: &rt::Placeholder, args: &[ArgumentV1<'_>]) -> Result {
-    fmt.fill = arg.format.fill;
-    fmt.align = arg.format.align;
-    fmt.flags = arg.format.flags;
+    fmt.fill = arg.fill;
+    fmt.align = arg.align;
+    fmt.flags = arg.flags;
     // SAFETY: arg and args come from the same Arguments,
     // which guarantees the indexes are always within bounds.
     unsafe {
-        fmt.width = getcount(args, &arg.format.width);
-        fmt.precision = getcount(args, &arg.format.precision);
+        fmt.width = getcount(args, &arg.width);
+        fmt.precision = getcount(args, &arg.precision);
     }
 
     // Extract the correct argument
diff --git a/library/core/src/fmt/rt.rs b/library/core/src/fmt/rt.rs
index 497b2e27739..a431ee54d95 100644
--- a/library/core/src/fmt/rt.rs
+++ b/library/core/src/fmt/rt.rs
@@ -7,11 +7,6 @@
 #[derive(Copy, Clone)]
 pub struct Placeholder {
     pub position: usize,
-    pub format: FormatSpec,
-}
-
-#[derive(Copy, Clone)]
-pub struct FormatSpec {
     pub fill: char,
     pub align: Alignment,
     pub flags: u32,
@@ -29,7 +24,7 @@ impl Placeholder {
         precision: Count,
         width: Count,
     ) -> Self {
-        Self { position, format: FormatSpec { fill, align, flags, precision, width } }
+        Self { position, fill, align, flags, precision, width }
     }
 }