Skip to content

Commit 010797e

Browse files
committed
Rename to ZeroPadding and AlignmentFlag
1 parent ecc7ae4 commit 010797e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

common/src/format.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,10 +623,10 @@ impl FormatSpec {
623623
format!("{formatted_re}{formatted_im}")
624624
};
625625
if let Some(FormatAlign::AfterSign) = &self.align {
626-
return Err(FormatSpecError::AlignmentFlagNotAllowed);
626+
return Err(FormatSpecError::AlignmentFlag);
627627
}
628628
match &self.fill.unwrap_or(' '.into()).to_char() {
629-
Some('0') => Err(FormatSpecError::ZeroPaddingNotAllowed),
629+
Some('0') => Err(FormatSpecError::ZeroPadding),
630630
_ => self.format_sign_and_align(&AsciiStr::new(&magnitude_str), "", FormatAlign::Right),
631631
}
632632
}
@@ -823,8 +823,8 @@ pub enum FormatSpecError {
823823
NotAllowed(&'static str),
824824
UnableToConvert,
825825
CodeNotInRange,
826-
ZeroPaddingNotAllowed,
827-
AlignmentFlagNotAllowed,
826+
ZeroPadding,
827+
AlignmentFlag,
828828
NotImplemented(char, &'static str),
829829
}
830830

vm/src/format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ impl IntoPyException for FormatSpecError {
3434
}
3535
Self::UnableToConvert => vm.new_value_error("Unable to convert int to float"),
3636
Self::CodeNotInRange => vm.new_overflow_error("%c arg not in range(0x110000)"),
37-
Self::ZeroPaddingNotAllowed => {
37+
Self::ZeroPadding => {
3838
vm.new_value_error("Zero padding is not allowed in complex format specifier")
3939
}
40-
Self::AlignmentFlagNotAllowed => {
40+
Self::AlignmentFlag => {
4141
vm.new_value_error("'=' alignment flag is not allowed in complex format specifier")
4242
}
4343
Self::NotImplemented(c, s) => {

0 commit comments

Comments
 (0)