Skip to content

Commit 55c7b78

Browse files
committed
refactor: remove default implementation for DefaultPostComputeRunner
1 parent d5ad3f0 commit 55c7b78

File tree

1 file changed

+5
-32
lines changed

1 file changed

+5
-32
lines changed

post-compute/src/compute/app_runner.rs

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,7 @@ pub struct DefaultPostComputeRunner {
4949
worker_api_client: WorkerApiClient,
5050
}
5151

52-
impl Default for DefaultPostComputeRunner {
53-
fn default() -> Self {
54-
Self::new()
55-
}
56-
}
57-
52+
#[allow(clippy::new_without_default)] // We don't need a default constructor for the DefaultPostComputeRunner struct
5853
impl DefaultPostComputeRunner {
5954
pub fn new() -> Self {
6055
Self {
@@ -152,37 +147,15 @@ impl PostComputeRunnerInterface for DefaultPostComputeRunner {
152147
/// # Example
153148
///
154149
/// ```rust
155-
/// use tee_worker_post_compute::{
156-
/// api::worker_api::ExitMessage,
157-
/// compute::{
158-
/// errors::ReplicateStatusCause,
159-
/// app_runner::{start_with_runner, DefaultPostComputeRunner, PostComputeRunnerInterface},
160-
/// computed_file::ComputedFile,
161-
/// }
150+
/// use tee_worker_post_compute::compute::app_runner::{
151+
/// start_with_runner,
152+
/// DefaultPostComputeRunner,
153+
/// PostComputeRunnerInterface,
162154
/// };
163155
///
164156
/// // Using the default runner
165157
/// let runner = DefaultPostComputeRunner::new();
166158
/// let exit_code = start_with_runner(&runner);
167-
///
168-
/// // Using a custom runner
169-
/// struct MyCustomRunner;
170-
/// impl PostComputeRunnerInterface for MyCustomRunner {
171-
/// fn run_post_compute(&self, _: &str) -> Result<(), ReplicateStatusCause> {
172-
/// Ok(())
173-
/// }
174-
/// fn get_challenge(&self, _: &str) -> Result<String, ReplicateStatusCause> {
175-
/// Ok("challenge".to_string())
176-
/// }
177-
/// fn send_exit_cause(&self, _: &str, _: &str, _: &ExitMessage<'_>) -> Result<(), ReplicateStatusCause> {
178-
/// Ok(())
179-
/// }
180-
/// fn send_computed_file(&self, _: &ComputedFile) -> Result<(), ReplicateStatusCause> {
181-
/// Ok(())
182-
/// }
183-
/// }
184-
/// let custom_runner = MyCustomRunner;
185-
/// let exit_code = start_with_runner(&custom_runner);
186159
/// ```
187160
pub fn start_with_runner<R: PostComputeRunnerInterface>(runner: &R) -> ExitMode {
188161
println!("Tee worker post-compute started");

0 commit comments

Comments
 (0)