style: apply cargo fmt
This commit is contained in:
@@ -245,13 +245,13 @@ impl PeerActor {
|
||||
"[peer:{}] Place in queue response - file: {}, place: {}",
|
||||
username, filename, place
|
||||
);
|
||||
if let Err(e) =
|
||||
self.client_channel.send(ClientOperation::PlaceInQueueUpdate {
|
||||
if let Err(e) = self.client_channel.send(
|
||||
ClientOperation::PlaceInQueueUpdate {
|
||||
username: username.clone(),
|
||||
filename,
|
||||
place,
|
||||
})
|
||||
{
|
||||
},
|
||||
) {
|
||||
error!(
|
||||
"[peer:{}] failed to forward PlaceInQueueUpdate: {}",
|
||||
username, e
|
||||
|
||||
@@ -1066,9 +1066,8 @@ impl Client {
|
||||
place,
|
||||
} => match client_context.write_safe() {
|
||||
Ok(mut ctx) => {
|
||||
let updated = ctx
|
||||
.downloads
|
||||
.update_queue_position(
|
||||
let updated =
|
||||
ctx.downloads.update_queue_position(
|
||||
&username, &filename, place,
|
||||
);
|
||||
if !updated {
|
||||
|
||||
@@ -191,10 +191,7 @@ mod tests {
|
||||
store.add(download);
|
||||
|
||||
assert!(store.update_queue_position("peer", "song.mp3", 42));
|
||||
assert_eq!(
|
||||
store.get_by_token(1).unwrap().queue_position,
|
||||
Some(42)
|
||||
);
|
||||
assert_eq!(store.get_by_token(1).unwrap().queue_position, Some(42));
|
||||
|
||||
assert!(!store.update_queue_position("peer", "missing.mp3", 1));
|
||||
assert!(!store.update_queue_position("other", "song.mp3", 1));
|
||||
|
||||
Reference in New Issue
Block a user