Skip to content

Commit

Permalink
Rust fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
fogodev committed Sep 29, 2024
1 parent 9e00227 commit 7cd57c2
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 25 deletions.
2 changes: 1 addition & 1 deletion core/crates/cloud-services/src/sync/ingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ enum IngestStatus {
}

impl Ingester {
pub const fn new(
pub const fn new(
sync: SyncManager,
ingest_notify: Arc<Notify>,
active: Arc<AtomicBool>,
Expand Down
3 changes: 2 additions & 1 deletion core/crates/heavy-lifting/src/job_system/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,8 @@ impl JobTaskDispatcher {
matches!(
*state,
JobRunningState::Running
| JobRunningState::Canceled | JobRunningState::Shutdown
| JobRunningState::Canceled
| JobRunningState::Shutdown
)
})
.await
Expand Down
6 changes: 4 additions & 2 deletions core/crates/heavy-lifting/src/job_system/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,10 @@ impl Status {
matches!(
self,
Self::Completed
| Self::Canceled | Self::Paused
| Self::Failed | Self::CompletedWithErrors
| Self::Canceled
| Self::Paused
| Self::Failed
| Self::CompletedWithErrors
)
}
}
Expand Down
4 changes: 3 additions & 1 deletion core/crates/heavy-lifting/src/job_system/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ pub async fn load_jobs<OuterCtx: OuterContext, JobCtx: JobContext<OuterCtx>>(
root_job: StoredJob { id, .. },
next_jobs,
..
}| { iter::once(*id).chain(next_jobs.iter().map(|StoredJob { id, .. }| *id)) },
}| {
iter::once(*id).chain(next_jobs.iter().map(|StoredJob { id, .. }| *id))
},
)
.map(|job_id| uuid_to_bytes(&job_id))
.collect::<Vec<_>>(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,15 @@ pub const fn can_extract_for_audio(audio_extension: AudioExtension) -> bool {
matches!(
audio_extension,
Mp3 | Mp2
| M4a | Wav | Aiff
| Aif | Flac | Ogg
| Oga | Opus | Wma
| Amr | Aac | Wv
| Voc | Tta | Loas
| Caf | Aptx | Adts
| M4a | Wav
| Aiff | Aif
| Flac | Ogg
| Oga | Opus
| Wma | Amr
| Aac | Wv
| Voc | Tta
| Loas | Caf
| Aptx | Adts
| Ast | Mid
)
}
Expand All @@ -81,15 +84,18 @@ pub const fn can_extract_for_video(video_extension: VideoExtension) -> bool {
matches!(
video_extension,
Avi | Avifs
| Qt | Mov | Swf
| Mjpeg | Mpeg
| Mxf | M2v | Mpg
| Mpe | M2ts | Flv
| Wm | _3gp | M4v
| Wmv | Asf | Mp4
| Webm | Mkv | Vob
| Ogv | Wtv | Hevc
| F4v // | Ts | Mts TODO: Uncomment when we start using magic instead of extension
| Qt | Mov
| Swf | Mjpeg
| Mpeg | Mxf
| M2v | Mpg
| Mpe | M2ts
| Flv | Wm
| _3gp | M4v
| Wmv | Asf
| Mp4 | Webm
| Mkv | Vob
| Ogv | Wtv
| Hevc | F4v // | Ts | Mts TODO: Uncomment when we start using magic instead of extension
)
}

Expand Down
2 changes: 1 addition & 1 deletion core/crates/sync/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ impl Manager {
device_pub_id: &'a DevicePubId,
chunk_size: u32,
initial_timestamp: NTP64,
) -> impl Stream<Item = Result<Vec<CRDTOperation>, Error>> + Send + '_ {
) -> impl Stream<Item = Result<Vec<CRDTOperation>, Error>> + Send + 'a {
stream! {
let mut current_initial_timestamp = initial_timestamp;

Expand Down
3 changes: 2 additions & 1 deletion core/src/location/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,8 @@ async fn create_location(
.location()
.count(vec![location::path::equals(Some(path.clone()))])
.exec()
.await? > 0
.await?
> 0
{
return Err(LocationError::LocationAlreadyExists(location_path.into()));
}
Expand Down
6 changes: 4 additions & 2 deletions core/src/old_job/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,10 @@ impl JobStatus {
matches!(
self,
Self::Completed
| Self::Canceled | Self::Paused
| Self::Failed | Self::CompletedWithErrors
| Self::Canceled
| Self::Paused
| Self::Failed
| Self::CompletedWithErrors
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/actors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl<Id: ActorId> ActorsCollection<Id> {

#[instrument(skip(self))]
pub async fn start(&self, identifier: Id) {
let mut actors_map = self.actors_map.write().await;
let mut actors_map = self.actors_map.write().await;
if let Some(actor) = actors_map.get_mut(&identifier) {
if actor.is_running.load(Ordering::Acquire) {
warn!("Actor already running!");
Expand Down

0 comments on commit 7cd57c2

Please sign in to comment.