Skip to content

Commit e5f6be7

Browse files
committed
strftime: move error() method below caller
1 parent d516c27 commit e5f6be7

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/format/strftime.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -426,22 +426,6 @@ impl<'a> StrftimeItems<'a> {
426426
.collect()
427427
}
428428

429-
fn error<'b>(
430-
&mut self,
431-
original: &'b str,
432-
error_len: &mut usize,
433-
ch: Option<char>,
434-
) -> (&'b str, Item<'b>) {
435-
if !self.lenient {
436-
return (&original[*error_len..], Item::Error);
437-
}
438-
439-
if let Some(c) = ch {
440-
*error_len -= c.len_utf8();
441-
}
442-
(&original[*error_len..], Item::Literal(&original[..*error_len]))
443-
}
444-
445429
fn parse_next_item(&mut self, mut remainder: &'a str) -> Option<(&'a str, Item<'a>)> {
446430
use InternalInternal::*;
447431
use Item::{Literal, Space};
@@ -732,6 +716,22 @@ impl<'a> StrftimeItems<'a> {
732716
}
733717
}
734718

719+
fn error<'b>(
720+
&mut self,
721+
original: &'b str,
722+
error_len: &mut usize,
723+
ch: Option<char>,
724+
) -> (&'b str, Item<'b>) {
725+
if !self.lenient {
726+
return (&original[*error_len..], Item::Error);
727+
}
728+
729+
if let Some(c) = ch {
730+
*error_len -= c.len_utf8();
731+
}
732+
(&original[*error_len..], Item::Literal(&original[..*error_len]))
733+
}
734+
735735
#[cfg(feature = "unstable-locales")]
736736
fn switch_to_locale_str(
737737
&mut self,

0 commit comments

Comments
 (0)