mirror of
https://github.com/MedzikUser/imgurs
synced 2024-08-15 00:03:19 +00:00
rustfmt
This commit is contained in:
parent
461b53d681
commit
7598ba5293
2 changed files with 29 additions and 9 deletions
|
@ -1,7 +1,7 @@
|
||||||
use colored::Colorize;
|
|
||||||
use chrono::{prelude::DateTime, Utc};
|
use chrono::{prelude::DateTime, Utc};
|
||||||
use std::time::{Duration, UNIX_EPOCH};
|
use colored::Colorize;
|
||||||
use imgurs::api::{rate_limit::rate_limit, ImgurClient};
|
use imgurs::api::{rate_limit::rate_limit, ImgurClient};
|
||||||
|
use std::time::{Duration, UNIX_EPOCH};
|
||||||
|
|
||||||
pub async fn credits(client: ImgurClient) {
|
pub async fn credits(client: ImgurClient) {
|
||||||
let i = rate_limit(client).await.expect("send api request");
|
let i = rate_limit(client).await.expect("send api request");
|
||||||
|
@ -10,10 +10,30 @@ pub async fn credits(client: ImgurClient) {
|
||||||
let datetime = DateTime::<Utc>::from(date);
|
let datetime = DateTime::<Utc>::from(date);
|
||||||
let timestamp_str = datetime.format("%Y-%m-%d %H:%M:%S").to_string();
|
let timestamp_str = datetime.format("%Y-%m-%d %H:%M:%S").to_string();
|
||||||
|
|
||||||
println!("{} {}", "user limit".green(), i.data.user_limit.to_string().magenta());
|
println!(
|
||||||
println!("{} {}", "user remaining".green(), i.data.user_remaining.to_string().magenta());
|
"{} {}",
|
||||||
println!("{} {} {}", "user reset".green(), timestamp_str.magenta(), "(UTC)".blue());
|
"user limit".green(),
|
||||||
println!("{} {}", "client limit".green(), i.data.client_limit.to_string().magenta());
|
i.data.user_limit.to_string().magenta()
|
||||||
println!("{} {}", "client remaining ".green(), i.data.client_remaining.to_string().magenta());
|
);
|
||||||
|
println!(
|
||||||
|
"{} {}",
|
||||||
|
"user remaining".green(),
|
||||||
|
i.data.user_remaining.to_string().magenta()
|
||||||
|
);
|
||||||
|
println!(
|
||||||
|
"{} {} {}",
|
||||||
|
"user reset".green(),
|
||||||
|
timestamp_str.magenta(),
|
||||||
|
"(UTC)".blue()
|
||||||
|
);
|
||||||
|
println!(
|
||||||
|
"{} {}",
|
||||||
|
"client limit".green(),
|
||||||
|
i.data.client_limit.to_string().magenta()
|
||||||
|
);
|
||||||
|
println!(
|
||||||
|
"{} {}",
|
||||||
|
"client remaining ".green(),
|
||||||
|
i.data.client_remaining.to_string().magenta()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,9 @@ pub mod info_image;
|
||||||
pub mod parse;
|
pub mod parse;
|
||||||
pub mod upload_image;
|
pub mod upload_image;
|
||||||
|
|
||||||
use imgurs::api::ImageInfo;
|
|
||||||
use chrono::{prelude::DateTime, Utc};
|
use chrono::{prelude::DateTime, Utc};
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
|
use imgurs::api::ImageInfo;
|
||||||
use std::time::{Duration, UNIX_EPOCH};
|
use std::time::{Duration, UNIX_EPOCH};
|
||||||
|
|
||||||
pub fn print_image_info(i: ImageInfo) {
|
pub fn print_image_info(i: ImageInfo) {
|
||||||
|
|
Loading…
Reference in a new issue