mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +00:00
Fix formatting
This commit is contained in:
parent
7c3d89112d
commit
11ce29077e
4 changed files with 13 additions and 12 deletions
|
@ -31,13 +31,10 @@ impl Credentials {
|
|||
/// ### Example
|
||||
/// ```rust
|
||||
/// use librespot_core::authentication::Credentials;
|
||||
///
|
||||
///
|
||||
/// let creds = Credentials::with_password("my account", "my password");
|
||||
/// ```
|
||||
pub fn with_password(
|
||||
username: impl Into<String>,
|
||||
password: impl Into<String>,
|
||||
) -> Credentials {
|
||||
pub fn with_password(username: impl Into<String>, password: impl Into<String>) -> Credentials {
|
||||
Credentials {
|
||||
username: username.into(),
|
||||
auth_type: AuthenticationType::AUTHENTICATION_USER_PASS,
|
||||
|
|
|
@ -20,7 +20,9 @@ async fn main() {
|
|||
|
||||
println!("Connecting..");
|
||||
let credentials = Credentials::with_password(&args[1], &args[2]);
|
||||
let session = Session::connect(session_config, credentials, None).await.unwrap();
|
||||
let session = Session::connect(session_config, credentials, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
println!(
|
||||
"Token: {:#?}",
|
||||
|
|
|
@ -4,8 +4,8 @@ use librespot::core::authentication::Credentials;
|
|||
use librespot::core::config::SessionConfig;
|
||||
use librespot::core::session::Session;
|
||||
use librespot::core::spotify_id::SpotifyId;
|
||||
use librespot::playback::config::PlayerConfig;
|
||||
use librespot::playback::audio_backend;
|
||||
use librespot::playback::config::PlayerConfig;
|
||||
use librespot::playback::player::Player;
|
||||
|
||||
#[tokio::main]
|
||||
|
@ -25,11 +25,11 @@ async fn main() {
|
|||
let backend = audio_backend::find(None).unwrap();
|
||||
|
||||
println!("Connecting ..");
|
||||
let session = Session::connect(session_config, credentials, None).await.unwrap();
|
||||
let session = Session::connect(session_config, credentials, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let (mut player, _) = Player::new(player_config, session, None, move || {
|
||||
backend(None)
|
||||
});
|
||||
let (mut player, _) = Player::new(player_config, session, None, move || backend(None));
|
||||
|
||||
player.load(track, true, 0);
|
||||
|
||||
|
|
|
@ -25,7 +25,9 @@ async fn main() {
|
|||
|
||||
let plist_uri = SpotifyId::from_base62(uri_parts[2]).unwrap();
|
||||
|
||||
let session = Session::connect(session_config, credentials, None).await.unwrap();
|
||||
let session = Session::connect(session_config, credentials, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let plist = Playlist::get(&session, plist_uri).await.unwrap();
|
||||
println!("{:?}", plist);
|
||||
|
|
Loading…
Reference in a new issue