Skip to content

Commit 218eced

Browse files
committed
style: format with style edition 2024
1 parent 056d125 commit 218eced

62 files changed

Lines changed: 196 additions & 139 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

audio/src/fetch/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ use std::{
55
fs,
66
io::{self, Read, Seek, SeekFrom},
77
sync::{
8-
atomic::{AtomicBool, AtomicUsize, Ordering},
98
Arc, OnceLock,
9+
atomic::{AtomicBool, AtomicUsize, Ordering},
1010
},
1111
time::Duration,
1212
};
1313

14-
use futures_util::{future::IntoStream, StreamExt, TryFutureExt};
15-
use hyper::{body::Incoming, header::CONTENT_RANGE, Response, StatusCode};
14+
use futures_util::{StreamExt, TryFutureExt, future::IntoStream};
15+
use hyper::{Response, StatusCode, body::Incoming, header::CONTENT_RANGE};
1616
use hyper_util::client::legacy::ResponseFuture;
1717
use parking_lot::{Condvar, Mutex};
1818
use tempfile::NamedTempFile;
1919
use thiserror::Error;
20-
use tokio::sync::{mpsc, oneshot, Semaphore};
20+
use tokio::sync::{Semaphore, mpsc, oneshot};
2121

22-
use librespot_core::{cdn_url::CdnUrl, Error, FileId, Session};
22+
use librespot_core::{Error, FileId, Session, cdn_url::CdnUrl};
2323

2424
use self::receive::audio_file_fetch;
2525

audio/src/fetch/receive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use hyper::StatusCode;
1212
use tempfile::NamedTempFile;
1313
use tokio::sync::{mpsc, oneshot};
1414

15-
use librespot_core::{http_client::HttpClient, session::Session, Error};
15+
use librespot_core::{Error, http_client::HttpClient, session::Session};
1616

1717
use crate::range_set::{Range, RangeSet};
1818

connect/src/context_resolver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::{
44
autoplay_context_request::AutoplayContextRequest, context::Context,
55
transfer_state::TransferState,
66
},
7-
state::{context::ContextType, ConnectState},
7+
state::{ConnectState, context::ContextType},
88
};
99
use std::{
1010
cmp::PartialEq,

connect/src/shuffle_vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rand::{rngs::SmallRng, Rng, SeedableRng};
1+
use rand::{Rng, SeedableRng, rngs::SmallRng};
22
use std::{
33
ops::{Deref, DerefMut},
44
vec::IntoIter,

connect/src/spirc.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
use crate::{
2+
LoadContextOptions, LoadRequestOptions, PlayContext,
23
context_resolver::{ContextAction, ContextResolver, ResolveContext},
34
core::{
5+
Error, Session, SpotifyId,
46
authentication::Credentials,
57
dealer::{
68
manager::{BoxedStream, BoxedStreamResult, Reply, RequestReply},
79
protocol::{Command, FallbackWrapper, Message, Request},
810
},
911
session::UserAttributes,
10-
Error, Session, SpotifyId,
1112
},
1213
model::{LoadRequest, PlayingTrack, SpircPlayStatus},
1314
playback::{
@@ -28,15 +29,14 @@ use crate::{
2829
provider::IsProvider,
2930
{ConnectConfig, ConnectState},
3031
},
31-
LoadContextOptions, LoadRequestOptions, PlayContext,
3232
};
3333
use futures_util::StreamExt;
3434
use librespot_protocol::context_page::ContextPage;
3535
use protobuf::MessageField;
3636
use std::{
3737
future::Future,
38-
sync::atomic::{AtomicUsize, Ordering},
3938
sync::Arc,
39+
sync::atomic::{AtomicUsize, Ordering},
4040
time::{Duration, SystemTime, UNIX_EPOCH},
4141
};
4242
use thiserror::Error;
@@ -951,7 +951,8 @@ impl SpircTask {
951951
{
952952
debug!(
953953
"ignoring context update for <{:?}>, because it isn't the current context <{}>",
954-
update_context.context.uri, self.connect_state.context_uri()
954+
update_context.context.uri,
955+
self.connect_state.context_uri()
955956
)
956957
} else {
957958
self.context_resolver.add(ResolveContext::from_context(
@@ -1615,7 +1616,9 @@ impl SpircTask {
16151616
let uri = String::from_utf8(uri)?;
16161617

16171618
if self.connect_state.context_uri() != &uri {
1618-
debug!("ignoring playlist modification update for playlist <{uri}>, because it isn't the current context");
1619+
debug!(
1620+
"ignoring playlist modification update for playlist <{uri}>, because it isn't the current context"
1621+
);
16191622
return Ok(());
16201623
}
16211624

connect/src/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ mod transfer;
99

1010
use crate::{
1111
core::{
12-
config::DeviceType, date::Date, dealer::protocol::Request, spclient::SpClientResult,
13-
version, Error, Session,
12+
Error, Session, config::DeviceType, date::Date, dealer::protocol::Request,
13+
spclient::SpClientResult, version,
1414
},
1515
model::SpircPlayStatus,
1616
protocol::{

connect/src/state/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use crate::{
99
},
1010
shuffle_vec::ShuffleVec,
1111
state::{
12+
ConnectState, SPOTIFY_MAX_NEXT_TRACKS_SIZE, StateError,
1213
metadata::Metadata,
1314
provider::{IsProvider, Provider},
14-
ConnectState, StateError, SPOTIFY_MAX_NEXT_TRACKS_SIZE,
1515
},
1616
};
1717
use protobuf::MessageField;

connect/src/state/handle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::{
2-
core::{dealer::protocol::SetQueueCommand, Error},
2+
core::{Error, dealer::protocol::SetQueueCommand},
33
state::{
4+
ConnectState,
45
context::{ContextType, ResetContext},
56
metadata::Metadata,
6-
ConnectState,
77
},
88
};
99
use protobuf::MessageField;

connect/src/state/options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use crate::{
22
core::Error,
33
protocol::player::ContextPlayerOptions,
44
state::{
5+
ConnectState, StateError,
56
context::{ContextType, ResetContext},
67
metadata::Metadata,
7-
ConnectState, StateError,
88
},
99
};
1010
use protobuf::MessageField;

connect/src/state/restrictions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::state::provider::IsProvider;
21
use crate::state::ConnectState;
2+
use crate::state::provider::IsProvider;
33
use librespot_protocol::player::Restrictions;
44
use protobuf::MessageField;
55

0 commit comments

Comments
 (0)