Skip to content

Commit bca80d8

Browse files
committed
Get rid of core::fmt::FormatSpec.
1 parent 938efe6 commit bca80d8

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

library/core/src/fmt/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1277,14 +1277,14 @@ pub fn write(output: &mut dyn Write, args: Arguments<'_>) -> Result {
12771277
}
12781278

12791279
unsafe fn run(fmt: &mut Formatter<'_>, arg: &rt::Placeholder, args: &[ArgumentV1<'_>]) -> Result {
1280-
fmt.fill = arg.format.fill;
1281-
fmt.align = arg.format.align;
1282-
fmt.flags = arg.format.flags;
1280+
fmt.fill = arg.fill;
1281+
fmt.align = arg.align;
1282+
fmt.flags = arg.flags;
12831283
// SAFETY: arg and args come from the same Arguments,
12841284
// which guarantees the indexes are always within bounds.
12851285
unsafe {
1286-
fmt.width = getcount(args, &arg.format.width);
1287-
fmt.precision = getcount(args, &arg.format.precision);
1286+
fmt.width = getcount(args, &arg.width);
1287+
fmt.precision = getcount(args, &arg.precision);
12881288
}
12891289

12901290
// Extract the correct argument

library/core/src/fmt/rt.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
#[derive(Copy, Clone)]
88
pub struct Placeholder {
99
pub position: usize,
10-
pub format: FormatSpec,
11-
}
12-
13-
#[derive(Copy, Clone)]
14-
pub struct FormatSpec {
1510
pub fill: char,
1611
pub align: Alignment,
1712
pub flags: u32,
@@ -29,7 +24,7 @@ impl Placeholder {
2924
precision: Count,
3025
width: Count,
3126
) -> Self {
32-
Self { position, format: FormatSpec { fill, align, flags, precision, width } }
27+
Self { position, fill, align, flags, precision, width }
3328
}
3429
}
3530

0 commit comments

Comments
 (0)