about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2023-01-11 21:37:27 +0100
committerMara Bos <m-ou.se@m-ou.se>2023-01-11 21:53:24 +0100
commite83945150f65eaf8b644a4042229fcac4c82596b (patch)
tree468c105cb121f1e94e32af68e49b2c957b6a9620
parentbebf9fe0635ad58bff020b754cd0f24c35291d51 (diff)
downloadrust-e83945150f65eaf8b644a4042229fcac4c82596b.tar.gz
rust-e83945150f65eaf8b644a4042229fcac4c82596b.zip
Add new fn to core::fmt::rt::v1::Argument.
-rw-r--r--library/core/src/fmt/rt/v1.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/library/core/src/fmt/rt/v1.rs b/library/core/src/fmt/rt/v1.rs
index 8a3de89e18b..e61b89fad5d 100644
--- a/library/core/src/fmt/rt/v1.rs
+++ b/library/core/src/fmt/rt/v1.rs
@@ -22,6 +22,19 @@ pub struct FormatSpec {
     pub width: Count,
 }
 
+impl Argument {
+    pub fn new(
+        position: usize,
+        fill: char,
+        align: Alignment,
+        flags: u32,
+        precision: Count,
+        width: Count,
+    ) -> Self {
+        Self { position, format: FormatSpec { fill, align, flags, precision, width } }
+    }
+}
+
 /// Possible alignments that can be requested as part of a formatting directive.
 #[cfg_attr(not(bootstrap), lang = "format_alignment")]
 #[derive(Copy, Clone, PartialEq, Eq)]