Skip to content

Commit e839451

Browse files
committed
Add new fn to core::fmt::rt::v1::Argument.
1 parent bebf9fe commit e839451

File tree

1 file changed

+13
-0
lines changed
  • library/core/src/fmt/rt

1 file changed

+13
-0
lines changed

library/core/src/fmt/rt/v1.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ pub struct FormatSpec {
2222
pub width: Count,
2323
}
2424

25+
impl Argument {
26+
pub fn new(
27+
position: usize,
28+
fill: char,
29+
align: Alignment,
30+
flags: u32,
31+
precision: Count,
32+
width: Count,
33+
) -> Self {
34+
Self { position, format: FormatSpec { fill, align, flags, precision, width } }
35+
}
36+
}
37+
2538
/// Possible alignments that can be requested as part of a formatting directive.
2639
#[cfg_attr(not(bootstrap), lang = "format_alignment")]
2740
#[derive(Copy, Clone, PartialEq, Eq)]

0 commit comments

Comments
 (0)