Skip to content

Commit e60a264

Browse files
committed
Remove map_err
1 parent 1534112 commit e60a264

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

common/src/format.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,6 @@ impl FormatSpec {
522522
sign_str,
523523
FormatAlign::Right,
524524
)
525-
.map_err(|msg| msg.to_owned())
526525
}
527526

528527
#[inline]
@@ -605,7 +604,6 @@ impl FormatSpec {
605604
&sign_prefix,
606605
FormatAlign::Right,
607606
)
608-
.map_err(|msg| msg.to_owned())
609607
}
610608

611609
pub fn format_string(&self, s: &BorrowedStr) -> Result<String, String> {
@@ -618,8 +616,7 @@ impl FormatSpec {
618616
value.truncate(precision);
619617
}
620618
value
621-
})
622-
.map_err(|msg| msg.to_owned()),
619+
}),
623620
_ => {
624621
let ch = char::from(self.format_type.as_ref().unwrap());
625622
Err(format!(
@@ -635,7 +632,7 @@ impl FormatSpec {
635632
magnitude_str: &BorrowedStr,
636633
sign_str: &str,
637634
default_align: FormatAlign,
638-
) -> Result<String, &'static str> {
635+
) -> Result<String, String> {
639636
let align = self.align.unwrap_or(default_align);
640637

641638
let num_chars = magnitude_str.char_len();

0 commit comments

Comments
 (0)