GyrosOfWar / youtube-dl-rs

A youtube-dl wrapper for Rust
132 stars 40 forks source link

Example url does not work unless converted to String #20

Closed tchua0927 closed 2 years ago

tchua0927 commented 2 years ago

I was testing out the example code and it kept returning an error unless I manually adjusted the url to be a String instead of &str (I used .to_string(). I you should either update the example code or the inner workings of the ::new function to reflect whichever you prefer.

GyrosOfWar commented 2 years ago

Hmm, that's odd, it seems to work fine for me. The new function accepts an argument of the type impl Into<String>, which definitely covers &str. I've added two examples in the examples folder that are runnable by themselves (if you clone the repository, do cargo run --example simple).

What error are you getting?

tchua0927 commented 2 years ago

Hmm. This is peculiar. I cannot replicate the error from a month ago. I run the simple example and it works. I run my own code with just &str and it works.

I am not doing anything different as I copied the exact code I used back then. I guess we can close this issue as it seems to have disappeared.