A Rusty program that provides ShareX utility commands
Go to file
IndyV 8da5ff8f8b Initial commit 2022-10-26 22:58:36 +02:00
src Initial commit 2022-10-26 22:58:36 +02:00
.gitignore Initial commit 2022-10-26 22:58:36 +02:00
Cargo.lock Initial commit 2022-10-26 22:58:36 +02:00
Cargo.toml Initial commit 2022-10-26 22:58:36 +02:00
README.md Initial commit 2022-10-26 22:58:36 +02:00
lint.sh Initial commit 2022-10-26 22:58:36 +02:00

README.md

Delete ShareX online hosted images

A simple program that deletes all images that are hosted on online image hosting by sending POST requests to all DeletionURL's.

Usage

./sharextended.exe --help

TODO

  • Unwrap and expect should be replaced with proper error handling.
  • Add GitHub action to build and release binaries (Windows only, since ShareX is Windows only).

Motivation

Why Rust?

I wanted to try out the most loved language for myself. While it's a bit hard to get started with due to these new concepts, like ownership, borrowing, and lifetimes, I really like it. It's a very powerful language with great error messages and many useful crates. I'm looking forward to learn more about it.

Code

Watching video's from No Boilerplate motivated me to try out Rust. On advise about your Rust toolkit, he suggested the following Clippy lints:

cargo clippy --fix -- -W clippy::pedantic -W clippy::nursery -W clippy::unwrap_used -W clippy::expect_used

For now I omit the clippy::unwrap_used. It's not great to use unwrap as often as I do, but I use it for getting things working. I'm sure I'll get better at error handling in the future.

I tried to store the static strings in the Cargo.toml, but I figured it's not meant to live outside the code. Also tried to resolve %USERPROFILE% in the code but solved it with the directories crate.

I used https://transform.tools/json-to-rust-serde as a reference for the JSON structure.