Clean up README and one condition

The compiler prefers `Vec.is_empty()` to `Vec.len() == 0`.
This commit is contained in:
Adam Cooper 2025-02-01 01:25:42 -05:00
parent 1351e163c6
commit 252983a368
2 changed files with 12 additions and 7 deletions

View file

@ -2,8 +2,13 @@
(N.B.: This software has not been made very useful for the non-amcooper user.)
This utility finds all your (well, my) Wallabag entries, and tags all the untagged ones "untagged". This allows the user to filter on the new tag, as there's no way to run a filter on untagged entries in the web UI.
This utility finds all your (well, my) Wallabag entries, and tags all the
untagged ones "untagged". This allows the user to filter on the new tag, as
there's no way to run a filter on untagged entries in the web UI.
Run the utility as follows: ` WALLABAG_CLIENT_SECRET=<client-secret> WALLABAG_PASSWORD=<password> cargo run`
Run the utility as follows: `WALLABAG_CLIENT_SECRET=<client-secret>
WALLABAG_PASSWORD=<password> cargo run`
It's a bit YOLO. There's almost no logging, no dry run, no way to limit the number of candidate entries, in general no way to recover if something goes awry. Even so, it can't really do a ton of damage as currently constructed.
It's a bit YOLO. There's almost no logging, no dry run, no way to limit the
number of candidate entries, in general no way to recover if something goes
awry. Even so, it can't really do a ton of damage as currently constructed.

View file

@ -26,10 +26,10 @@ async fn main() -> std::io::Result<()> {
}
Ok(entries) => {
for entry in entries {
if entry.tags.len() == 0 {
let _ = client.add_tags_to_entry(entry.id, vec!["untagged"]).await;
println!("{:?}", entry.title);
}
if entry.tags.is_empty() {
let _ = client.add_tags_to_entry(entry.id, vec!["untagged"]).await;
println!("{:?}", entry.title);
}
}
}
}