mirror of
https://github.com/timvisee/ffsend.git
synced 2025-10-06 02:29:57 +02:00
Create debug command, pretty print formatted tables
This commit is contained in:
parent
db1087c9e9
commit
7425c6c405
13 changed files with 192 additions and 24 deletions
|
@ -530,9 +530,9 @@ pub fn format_bytes(bytes: u64) -> String {
|
|||
/// - `9m55s`
|
||||
/// - `1s`
|
||||
/// - `now`
|
||||
pub fn format_duration(duration: &Duration) -> String {
|
||||
pub fn format_duration(duration: impl Borrow<Duration>) -> String {
|
||||
// Get the total number of seconds, return immediately if zero or less
|
||||
let mut secs = duration.num_seconds();
|
||||
let mut secs = duration.borrow().num_seconds();
|
||||
if secs <= 0 {
|
||||
return "now".into();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue