Skip to content

Commit e91fa11

Browse files
committed
strftime needs to_string noe
1 parent b8548a9 commit e91fa11

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

datetime.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,10 @@ mod tests {
301301

302302
fn date_str<T: super::Date>(t: T) -> String {
303303
let tm = t.tm();
304-
tm.strftime("%Y-%m-%d").unwrap()
305-
304+
match tm.strftime("%Y-%m-%d") {
305+
Ok(x) => x.to_string(),
306+
Err(x) => x.to_string()
307+
}
306308
}
307309

308310
fn datetime_str<T: super::DateTime>(t: T) -> String {
@@ -312,7 +314,7 @@ mod tests {
312314
}
313315

314316
fn test_time<T: Eq + fmt::Show + Clone + ::Time>(i: T) {
315-
error!("{}, {}", i, time_str(i.clone()));
317+
debug!("test_time: {}, {}", i, time_str(i.clone()));
316318
let tm = i.tm();
317319
let i2: T = ::Time::from_tm(&tm);
318320
if i2 != i {
@@ -336,7 +338,7 @@ mod tests {
336338
}
337339

338340
fn test_date<T: Eq + fmt::Show + Clone + ::Date>(i: T) {
339-
error!("{} {}", i, date_str(i.clone()));
341+
debug!("test_date: {} {}", i, date_str(i.clone()));
340342
let tm = i.tm();
341343
let i2: T = ::Date::from_tm(&tm);
342344
if i2 != i {
@@ -368,6 +370,7 @@ mod tests {
368370
}
369371

370372
fn test_dt_str(s: &str) {
373+
debug!("test_dt_str: {}", s);
371374
let tsdr = timespec_from_str(s);
372375
match tsdr {
373376
Ok(dt) => {
@@ -394,6 +397,7 @@ mod tests {
394397
}
395398

396399
fn test_std_time(s: &str) {
400+
debug!("test_std_time: {}", s);
397401
let tsr = timespec_from_str(s);
398402
match tsr {
399403
Ok(gdt) => {

0 commit comments

Comments
 (0)