Skip to content

Commit 938efe6

Browse files
committed
Rename fmt::rt::Argument to Placeholder.
1 parent bc11b45 commit 938efe6

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

library/core/src/fmt/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ impl<'a> Arguments<'a> {
428428
/// An `UnsafeArg` is required because the following invariants must be held
429429
/// in order for this function to be safe:
430430
/// 1. The `pieces` slice must be at least as long as `fmt`.
431-
/// 2. Every [`rt::Argument::position`] value within `fmt` must be a
431+
/// 2. Every [`rt::Placeholder::position`] value within `fmt` must be a
432432
/// valid index of `args`.
433433
/// 3. Every [`rt::Count::Param`] within `fmt` must contain a valid index of
434434
/// `args`.
@@ -438,7 +438,7 @@ impl<'a> Arguments<'a> {
438438
pub fn new_v1_formatted(
439439
pieces: &'a [&'static str],
440440
args: &'a [ArgumentV1<'a>],
441-
fmt: &'a [rt::Argument],
441+
fmt: &'a [rt::Placeholder],
442442
_unsafe_arg: UnsafeArg,
443443
) -> Arguments<'a> {
444444
Arguments { pieces, fmt: Some(fmt), args }
@@ -500,7 +500,7 @@ pub struct Arguments<'a> {
500500
pieces: &'a [&'static str],
501501

502502
// Placeholder specs, or `None` if all specs are default (as in "{}{}").
503-
fmt: Option<&'a [rt::Argument]>,
503+
fmt: Option<&'a [rt::Placeholder]>,
504504

505505
// Dynamic arguments for interpolation, to be interleaved with string
506506
// pieces. (Every argument is preceded by a string piece.)
@@ -1276,7 +1276,7 @@ pub fn write(output: &mut dyn Write, args: Arguments<'_>) -> Result {
12761276
Ok(())
12771277
}
12781278

1279-
unsafe fn run(fmt: &mut Formatter<'_>, arg: &rt::Argument, args: &[ArgumentV1<'_>]) -> Result {
1279+
unsafe fn run(fmt: &mut Formatter<'_>, arg: &rt::Placeholder, args: &[ArgumentV1<'_>]) -> Result {
12801280
fmt.fill = arg.format.fill;
12811281
fmt.align = arg.format.align;
12821282
fmt.flags = arg.format.flags;

library/core/src/fmt/rt.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
66
#[lang = "format_placeholder"]
77
#[derive(Copy, Clone)]
8-
// FIXME: Rename this to Placeholder
9-
pub struct Argument {
8+
pub struct Placeholder {
109
pub position: usize,
1110
pub format: FormatSpec,
1211
}
@@ -20,7 +19,7 @@ pub struct FormatSpec {
2019
pub width: Count,
2120
}
2221

23-
impl Argument {
22+
impl Placeholder {
2423
#[inline(always)]
2524
pub const fn new(
2625
position: usize,

0 commit comments

Comments
 (0)