From a0c59941e3f6cca0ff1505c4ed431ac7327cc66a Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Thu, 3 Oct 2013 16:01:42 -0400 Subject: [PATCH] extra: remove unnecessary second level functions do_strptime() and do_strftime() --- src/libextra/time.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/libextra/time.rs b/src/libextra/time.rs index 795da44e224..c7add96fca1 100644 --- a/src/libextra/time.rs +++ b/src/libextra/time.rs @@ -174,15 +174,6 @@ pub fn now() -> Tm { at(get_time()) } -/// Parses the time from the string according to the format string. -pub fn strptime(s: &str, format: &str) -> Result { - do_strptime(s, format) -} - -/// Formats the time according to the format string. -pub fn strftime(format: &str, tm: &Tm) -> ~str { - do_strftime(format, tm) -} impl Tm { /// Convert time to the seconds from January 1, 1970 @@ -264,7 +255,8 @@ impl Tm { } } -fn do_strptime(s: &str, format: &str) -> Result { +/// Parses the time from the string according to the format string. +pub fn strptime(s: &str, format: &str) -> Result { fn match_str(s: &str, pos: uint, needle: &str) -> bool { let mut i = pos; for ch in needle.byte_iter() { @@ -733,7 +725,8 @@ fn do_strptime(s: &str, format: &str) -> Result { } } -fn do_strftime(format: &str, tm: &Tm) -> ~str { +/// Formats the time according to the format string. +pub fn strftime(format: &str, tm: &Tm) -> ~str { fn days_in_year(year: int) -> i32 { if ((year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0))) { 366 /* Days in a leap year */