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
|
/// ### Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// use librespot_core::authentication::Credentials;
|
/// use librespot_core::authentication::Credentials;
|
||||||
///
|
///
|
||||||
/// let creds = Credentials::with_password("my account", "my password");
|
/// let creds = Credentials::with_password("my account", "my password");
|
||||||
/// ```
|
/// ```
|
||||||
pub fn with_password(
|
pub fn with_password(username: impl Into<String>, password: impl Into<String>) -> Credentials {
|
||||||
username: impl Into<String>,
|
|
||||||
password: impl Into<String>,
|
|
||||||
) -> Credentials {
|
|
||||||
Credentials {
|
Credentials {
|
||||||
username: username.into(),
|
username: username.into(),
|
||||||
auth_type: AuthenticationType::AUTHENTICATION_USER_PASS,
|
auth_type: AuthenticationType::AUTHENTICATION_USER_PASS,
|
||||||
|
|
|
@ -20,7 +20,9 @@ async fn main() {
|
||||||
|
|
||||||
println!("Connecting..");
|
println!("Connecting..");
|
||||||
let credentials = Credentials::with_password(&args[1], &args[2]);
|
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!(
|
println!(
|
||||||
"Token: {:#?}",
|
"Token: {:#?}",
|
||||||
|
|
|
@ -4,8 +4,8 @@ use librespot::core::authentication::Credentials;
|
||||||
use librespot::core::config::SessionConfig;
|
use librespot::core::config::SessionConfig;
|
||||||
use librespot::core::session::Session;
|
use librespot::core::session::Session;
|
||||||
use librespot::core::spotify_id::SpotifyId;
|
use librespot::core::spotify_id::SpotifyId;
|
||||||
use librespot::playback::config::PlayerConfig;
|
|
||||||
use librespot::playback::audio_backend;
|
use librespot::playback::audio_backend;
|
||||||
|
use librespot::playback::config::PlayerConfig;
|
||||||
use librespot::playback::player::Player;
|
use librespot::playback::player::Player;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
@ -25,11 +25,11 @@ async fn main() {
|
||||||
let backend = audio_backend::find(None).unwrap();
|
let backend = audio_backend::find(None).unwrap();
|
||||||
|
|
||||||
println!("Connecting ..");
|
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 || {
|
let (mut player, _) = Player::new(player_config, session, None, move || backend(None));
|
||||||
backend(None)
|
|
||||||
});
|
|
||||||
|
|
||||||
player.load(track, true, 0);
|
player.load(track, true, 0);
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,9 @@ async fn main() {
|
||||||
|
|
||||||
let plist_uri = SpotifyId::from_base62(uri_parts[2]).unwrap();
|
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();
|
let plist = Playlist::get(&session, plist_uri).await.unwrap();
|
||||||
println!("{:?}", plist);
|
println!("{:?}", plist);
|
||||||
|
|
Loading…
Reference in a new issue