Mithronn / rusty_ytdl

A Rust library for Youtube video searcher and downloader
https://docs.rs/rusty_ytdl
MIT License
107 stars 20 forks source link

Allow passing VideoOptions by value or by reference to `new_with_options` - Closes #38 #41

Closed nick42d closed 2 months ago

nick42d commented 2 months ago

Follow on from issue #38.

This took a little more work than I was expecting, as I missed that Video stores VideoOptions, therefore we need a new lifetime parameter on Video to make this work. Unfortunately this is a breaking change for anyone storing a Video in a struct (not sure why you would), but I was able to avoid the main one (users passing VideoOptions by value) by relaxing the type signature of Video::new_with_options().

I also removed a redundant clone on the Video::get_options() method, needed to be touched anyway for this change.