Some style changes, removed useless matches and formats

This commit is contained in:
Daniel García
2018-06-11 15:44:37 +02:00
parent 57850a3379
commit 483066b9a0
10 changed files with 70 additions and 113 deletions

View File

@@ -70,7 +70,7 @@ pub fn delete_file(path: &str) -> bool {
}
const UNITS: [&'static str; 6] = ["bytes", "KB", "MB", "GB", "TB", "PB"];
const UNITS: [&str; 6] = ["bytes", "KB", "MB", "GB", "TB", "PB"];
pub fn get_display_size(size: i32) -> String {
let mut size = size as f64;
@@ -119,7 +119,7 @@ pub fn parse_option_string<S, T>(string: Option<S>) -> Option<T> where S: AsRef<
use chrono::NaiveDateTime;
const DATETIME_FORMAT: &'static str = "%Y-%m-%dT%H:%M:%S%.6fZ";
const DATETIME_FORMAT: &str = "%Y-%m-%dT%H:%M:%S%.6fZ";
pub fn format_date(date: &NaiveDateTime) -> String {
date.format(DATETIME_FORMAT).to_string()