Skip to content

Commit

Permalink
Merge pull request #58 from xrelkd/chore/nix
Browse files Browse the repository at this point in the history
chore(nix): update `flake.lock`
  • Loading branch information
xrelkd authored Dec 31, 2023
2 parents 396ad8b + 3909494 commit 3197b49
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
9 changes: 6 additions & 3 deletions caracal-daemon/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,12 @@ mod tests {

#[test]
fn test_command_simple() {
match Cli::parse_from(["program_name", "version"]).commands {
Some(Commands::Version { .. }) => (),
_ => panic!(),
if let Some(Commands::Version { .. }) =
Cli::parse_from(["program_name", "version"]).commands
{
// everything is good.
} else {
panic!();
}
}
}
9 changes: 6 additions & 3 deletions caracal/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,12 @@ mod tests {

#[test]
fn test_command_simple() {
match Cli::parse_from(["program_name", "version"]).commands {
Some(Commands::Version { .. }) => (),
_ => panic!(),
if let Some(Commands::Version { .. }) =
Cli::parse_from(["program_name", "version"]).commands
{
// everything is good.
} else {
panic!();
}
}
}
4 changes: 2 additions & 2 deletions crates/engine/src/downloader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ impl Downloader {
file_path: file_path.clone(),
chunk_receiver: chunk_receiver.clone(),
progress_updater: ProgressUpdater::from(event_sender.clone()),
worker_event_receiver,
event_receiver: worker_event_receiver,
};
let _handle = join_set.spawn(worker.serve());
}
Expand Down Expand Up @@ -311,7 +311,7 @@ impl Downloader {
sink: sink.clone(),
source: source.clone(),
file_path: file_path.clone(),
worker_event_receiver,
event_receiver: worker_event_receiver,
};

join_set.spawn(worker.serve())
Expand Down
6 changes: 3 additions & 3 deletions crates/engine/src/downloader/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ pub struct Worker {
pub source: Fetcher,
pub file_path: PathBuf,
pub chunk_receiver: async_channel::Receiver<Chunk>,
pub event_receiver: mpsc::UnboundedReceiver<WorkerEvent>,
pub progress_updater: ProgressUpdater,
pub worker_event_receiver: mpsc::UnboundedReceiver<WorkerEvent>,
}

impl Worker {
Expand All @@ -33,8 +33,8 @@ impl Worker {
sink,
file_path,
chunk_receiver,
mut event_receiver,
progress_updater,
mut worker_event_receiver,
} = self;

while let Ok(chunk) = chunk_receiver.recv().await {
Expand All @@ -55,7 +55,7 @@ impl Worker {

loop {
let new_bytes = stream.bytes();
let new_event = worker_event_receiver.recv();
let new_event = event_receiver.recv();
futures::pin_mut!(new_bytes);
futures::pin_mut!(new_event);

Expand Down
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3197b49

Please sign in to comment.