Small fix
This commit is contained in:
parent
a640c8a4eb
commit
b0843eb253
|
@ -15,10 +15,10 @@ clap = { version = "4.0.17", features = ["derive"] }
|
|||
reqwest = { version = "0.11", features = ["json"] }
|
||||
ansi_term = "0.12.1"
|
||||
chrono = { version = "0.4.22", features = ["serde"] }
|
||||
indicatif = "0.17.1"
|
||||
dialoguer = "0.10.2"
|
||||
indicatif = "0.17.1"
|
||||
console = "0.15.2"
|
||||
tinyfiledialogs = "3.9.1"
|
||||
open = "3.0.3"
|
||||
lazy_static = "1.4.0"
|
||||
console = "0.15.2"
|
||||
directories = "4.0.1"
|
|
@ -42,7 +42,7 @@ I tried to store the static strings in the `Cargo.toml`, but I figured it's not
|
|||
I used https://transform.tools/json-to-rust-serde as a reference for the JSON structure.
|
||||
|
||||
#### Crates used
|
||||
- `eyre`: For simple error handling
|
||||
- `eyre`: For simple error reporting
|
||||
- `tokyo` & `futures`: For writing async Rust
|
||||
- `serde` & `serde_json`: For JSON parsing
|
||||
- `clap`: For CLI parsing
|
||||
|
|
|
@ -201,12 +201,17 @@ fn filter_deletion_urls(items: &[HistoryItem], from_date: Option<DateTime<Local>
|
|||
async fn delete_urls(deletion_urls: Result<Vec<String>>) -> Result<()> {
|
||||
let deletion_urls = deletion_urls?;
|
||||
if deletion_urls.len() == 0 {
|
||||
println!("No items to delete");
|
||||
println!("{}", Colour::Yellow.bold().paint("No items to delete!"));
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if deletion_urls.len() > 1250 {
|
||||
println!("Amount of items to delete is too high for Imgur API, exiting...");
|
||||
println!(
|
||||
"{}",
|
||||
Colour::Yellow
|
||||
.bold()
|
||||
.paint("Amount of items to delete is too high for Imgur API, canceling...")
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue