File tree Expand file tree Collapse file tree
crates/hm/src/orchestrator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ pub(crate) async fn exec_impl(args: DockerExecArgs) -> Result<i32> {
122122 // Emit StepLog events for each line written; the writer below
123123 // forwards bytes into the event bus tagged with the current
124124 // thread-local step_id set by the scheduler.
125- let mut writer = StepLogWriter :: new ( ) ;
125+ let mut writer = StepLogWriter :: default ( ) ;
126126
127127 // Future doing the exec; we race it against cancellation.
128128 let cancel = s. cancel . clone ( ) ;
@@ -184,17 +184,13 @@ pub(crate) async fn stop_remove_impl(container_id: String) {
184184
185185/// Streams bytes from a Docker exec into per-line `StepLog` events on
186186/// the event bus. Buffers partial lines until a `\n` arrives.
187+ #[ derive( smart_default:: SmartDefault ) ]
187188struct StepLogWriter {
189+ #[ default( Vec :: with_capacity( 8192 ) ) ]
188190 buf : Vec < u8 > ,
189191}
190192
191193impl StepLogWriter {
192- fn new ( ) -> Self {
193- Self {
194- buf : Vec :: with_capacity ( 8192 ) ,
195- }
196- }
197-
198194 fn flush_line ( line : & [ u8 ] ) {
199195 let Some ( state) = current ( ) else { return } ;
200196 let Some ( step_id) = crate :: plugin:: host_fns:: current_step_id ( ) else {
You can’t perform that action at this time.
0 commit comments