You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
343 B
12 lines
343 B
pub fn seconds_as_time(secs: &i32) -> ::askama::Result<String> {
|
|
let minutes = secs / 60;
|
|
let seconds = secs % 60;
|
|
Ok(format!("{}:{}", minutes, seconds))
|
|
}
|
|
pub fn nullable<T: std::fmt::Display>(ot: &Option<T>) -> ::askama::Result<String> {
|
|
match ot {
|
|
Some(t) => Ok(format!("{}", t)),
|
|
None => Ok("NULL".to_string())
|
|
}
|
|
}
|