oSumAtrIX / DownOnSpot

🎧 A Spotify music and playlist downloader working with free Spotify accounts written in Rust
https://osumatrix.me
GNU General Public License v3.0
548 stars 45 forks source link

No method named unwrap found for struct #39

Closed rfranky closed 1 year ago

rfranky commented 1 year ago

Describe the bug Build failed -> No method named unwrap found for struct

To Reproduce Steps to reproduce the behavior:

Debian Buster rust version 1.65.0-nightly

cargo build --release

Build Log

Compiling librespot v0.3.1 error[E0061]: this function takes 3 arguments but 4 arguments were supplied --> src/spotify.rs:34:9 34 Some(Cache::new(Some(Path::new("credentials_cache")), None, None, None).unwrap()), ^^^^^^^^^^ ---- argument of type std::option::Option<_> unexpected
note: associated function defined here --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/librespot-core-0.3.1/src/cache.rs:240:12 240 pub fn new<P: AsRef>( ^^^ help: remove the extra argument
34 Some(Cache::new(Some(Path::new("credentials_cache")), None, None).unwrap()),
~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 4 arguments were supplied --> src/spotify.rs:31:22 31 let (session, _) = Session::connect( ^^^^^^^^^^^^^^^^ ... 35 true, ---- argument of type bool unexpected
note: associated function defined here --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/librespot-core-0.3.1/src/session.rs:65:18 65 pub async fn connect( ^^^^^^^ help: remove the extra argument
31 let (session, _) = Session::connect(SessionConfig::default(), credentials, Some(Cache::new(Some(Path::new("credentials_cache")), None, None, None).unwrap()))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types --> src/spotify.rs:31:7 31 let (session, _) = Session::connect( ___^^^^^^^^^^^^_-
expected struct Session, found tuple
32 SessionConfig::default(),
33 credentials,
34 Some(Cache::new(Some(Path::new("credentials_cache")), None, None, None).unwrap()),
35 true,
36 )
37 .await?;
___- this expression has type Session

= note: expected struct Session found tuple (_, _)

error[E0599]: no method named unwrap found for struct std::string::String in the current scope --> src/downloader.rs:507:52 | 507 | info!("{} Using {:?} format.", id.to_base62().unwrap(), format); | ^^^^^^ method not found in std::string::String

error[E0599]: no method named unwrap found for struct std::string::String in the current scope --> src/downloader.rs:518:53 | 518 | warn!("{} Falling back to: {:?}", id.to_base62().unwrap(), quality); | ^^^^^^ method not found in std::string::String

error[E0599]: no method named unwrap found for struct std::string::String in the current scope --> src/downloader.rs:576:54 | 576 | info!("Done downloading: {}", track.id.to_base62().unwrap()); | ^^^^^^ method not found in std::string::String

Some errors have detailed explanations: E0061, E0308, E0599. For more information about an error, try rustc --explain E0061. error: could not compile down_on_spot due to 6 previous errors