reujab / wallpaper.rs

A cross-platform Rust library for getting and setting desktop wallpapers
The Unlicense
96 stars 24 forks source link

Too many unnecessary dependencies when not using `set_from_url` #5

Closed Vanille-N closed 3 years ago

Vanille-N commented 4 years ago

I am myself developing a crate to create wallpapers, and as it is now I feel reluctant to use wallpaper as a dependency because the set_from_url pulls in many dependencies which I am not using (I only need the set_from_path function), and I would feel bad forcing my users to compile reqwest, url and all of their many dependencies. Apart from this single drawback, wallpaper is the best crate of its kind that I could find, and I would love for it to be a bit more lightweight for my use-case.

Case in point:

$ cd wallpaper.rs
$ cargo tree | wc -l
312

I know that there are duplicates, but this is still a bit much.

Proposal: make reqwest and url optional dependencies. Of course, they would be opt-out to avoid breaking any other crates.

If this proposal seems reasonable to you, I already have a pull request ready that implements it by adding a "from-url" feature enabled by default and that one can opt out of:

$ cd wallpaper.rs
$ cargo tree --no-default-features | wc -l
5