From c14072c349b7a57034a0aba288408ac06d803478 Mon Sep 17 00:00:00 2001 From: boasting-squirrel Date: Tue, 19 Feb 2019 20:24:34 +0100 Subject: Renamed humanize_duration to humanize_systemtime --- src/listing.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/listing.rs b/src/listing.rs index 9203f48..21aebec 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -198,7 +198,7 @@ pub fn directory_listing( let _ = write!( body, "{}/{}{}{}", - entry.link, entry.name, modification_date, modification_time, humanize_duration(entry.last_modification_date) + entry.link, entry.name, modification_date, modification_time, humanize_systemtime(entry.last_modification_date) ); } EntryType::File => { @@ -210,7 +210,7 @@ pub fn directory_listing( entry.size.unwrap(), modification_date, modification_time, - humanize_duration(entry.last_modification_date) + humanize_systemtime(entry.last_modification_date) ); } } @@ -329,7 +329,7 @@ fn convert_to_utc(src_time: Option) -> (String, String) { /// and gives a rough approximation of the elapsed time since /// /// If no SystemTime was given, returns an empty string -fn humanize_duration(src_time: Option) -> String { +fn humanize_systemtime(src_time: Option) -> String { src_time .and_then(|std_time| SystemTime::now().duration_since(std_time).ok()) .and_then(|from_now| Duration::from_std(from_now).ok()) -- cgit v1.2.3