Fix formatting

This commit is contained in:
johannesd3 2021-04-01 18:10:42 +02:00
parent 7c3d89112d
commit 11ce29077e
4 changed files with 13 additions and 12 deletions

View file

@ -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,

View file

@ -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: {:#?}",

View file

@ -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);

View file

@ -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);