Run rustfmt

This commit is contained in:
Koen Bolhuis 2021-01-14 03:29:21 +01:00
parent 7f8c4f3199
commit 64e180fb84
4 changed files with 12 additions and 15 deletions

View File

@ -1,5 +1,5 @@
use listenbrainz::Client;
use listenbrainz::models::request::DeleteListen;
use listenbrainz::Client;
fn main() {
let mut args = std::env::args().skip(1);

View File

@ -1,10 +1,13 @@
use std::time::{SystemTime, UNIX_EPOCH};
use listenbrainz::models::request::{ListenType, Payload, SubmitListens, TrackMetadata};
use listenbrainz::Client;
use listenbrainz::models::request::{SubmitListens, ListenType, Payload, TrackMetadata};
fn now() -> i64 {
SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() as i64
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
.as_secs() as i64
}
fn main() {
@ -53,7 +56,7 @@ fn main() {
// Submit imports
let first = Payload {
listened_at: Some(now() - 60*5),
listened_at: Some(now() - 60 * 5),
track_metadata: TrackMetadata {
artist_name: "Lil Tecca",
track_name: "All Star (with Lil Tjay)",
@ -62,7 +65,7 @@ fn main() {
},
};
let second = Payload {
listened_at: Some(now() - 60*15),
listened_at: Some(now() - 60 * 15),
track_metadata: TrackMetadata {
artist_name: "Queens of the Stone Age",
track_name: "None One Knows",
@ -71,13 +74,13 @@ fn main() {
},
};
let third = Payload {
listened_at: Some(now() - 60*10),
listened_at: Some(now() - 60 * 10),
track_metadata: TrackMetadata {
artist_name: "Alkaline Trio",
track_name: "Fall Victim",
release_name: Some("Crimson"),
additional_info: None,
}
},
};
let submission = SubmitListens {

View File

@ -11,12 +11,6 @@ fn main() {
let result = client.user_playing_now(&user_name);
println!("Playing now: {:#?}", result);
let result = client.user_listens(
&user_name,
None,
None,
Some(5),
None,
);
let result = client.user_listens(&user_name, None, None, Some(5), None);
println!("Recent listens: {:#?}", result);
}

View File

@ -10,7 +10,7 @@ use serde::Serialize;
#[derive(Debug, Serialize)]
pub struct SubmitListens<'a> {
pub listen_type: ListenType,
pub payload: &'a[Payload<'a>],
pub payload: &'a [Payload<'a>],
}
/// Type of the [`SubmitListens::listen_type`] field.